-
Notifications
You must be signed in to change notification settings - Fork 0
#75/#79: Implemented ci for gh workflows check if build needed and fixed print docker images #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
#75/#79: Implemented ci for gh workflows check if build needed and fixed print docker images #80
Conversation
res = lib_get_flavor_ci_model.get_flavor_ci_model(build_config, "flavor_a") | ||
assert res == FlavorCiConfig( | ||
build_runner="ubuntu-22.04", | ||
test_config=TestConfig( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, the test sets missing the language tests
and added unit test for get_build_runner
|
||
Print this help message: | ||
|
||
$ exaslci --help |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ exaslci --help | |
$ exaslc-ci --help |
|
||
Get the list of available flavors and write to $GITHUB_OUT: | ||
|
||
$ exaslct get-flavors --github-var flavors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ exaslct get-flavors --github-var flavors | |
$ exaslc-ci get-flavors --github-var flavors |
|
||
github_options = [ | ||
click.option( | ||
"--github-var", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"--github-var", | |
"--github-output-var", |
) | ||
|
||
base_branch_option = click.option( | ||
"--base-branch-name", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is usually a base-ref and not a branch. A ref can be anywhere in the history, it can be a commit hash, tag or branch
|
||
|
||
def get_all_affected_files(git_access: GitAccess, base_branch: str) -> List[Path]: | ||
base_last_commit_sha = git_access.get_head_commit_sha_of_branch(base_branch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed, because we get the ref from GitHub via the command line parameter
|
||
|
||
def get_build_config_model() -> BuildConfig: | ||
build_config_path = Path.cwd() / "build_config.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using cwd, we probably need to do a backwards search, if we want to make it properly, however, the question is this needed here, because the project is mainly used in a well defined environment.
|
||
def test_get_build_runner(cli, mock_get_build_runner): | ||
cli.run("--flavor", "flavor_a", "--github-var", "abc") | ||
assert cli.succeeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why that complicated
With assert mock_calls == [call(flavor=...,] you can handle all the asserts in one assert and probably also get better diff in case of a bug.
Ah, I see you need to test the GitHubAccess, I think that is best done by a Matcher Object
mock_calls == [call(flavor=...,github_access=IsInstance(GithubAccess))]
assert mock_get_flavors.call_count == 1 | ||
assert len(mock_get_flavors.call_args.args) == 0 | ||
assert len(mock_get_flavors.call_args.kwargs) == 1 | ||
assert isinstance(mock_get_flavors.call_args.kwargs["github_access"], GithubAccess) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment regarding mock_calls
assert isinstance( | ||
mock_check_if_build_needed.call_args.kwargs["github_access"], GithubAccess | ||
) | ||
assert isinstance( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment regarding mock_calls
fixes #75
fixes #79