-
Notifications
You must be signed in to change notification settings - Fork 59
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
chore: add integration test running in docker container #2613
Conversation
I'll remove this cloud build trigger once the PR is approved. |
) | ||
|
||
@classmethod | ||
def __run_entry_point_in_docker_container( |
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.
After creating entry_point.py
, there will be only once docker run
.
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.
LGTM
build_file = os.path.join( | ||
repo_root_dir, ".cloudbuild", "library_generation", "library_generation.Dockerfile" | ||
) | ||
image_tag = f"test-image:latest" |
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.
We don't have to use f string as this is a hardcoded value.
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.
Done
) | ||
os.remove(f"{description_file}") | ||
def test_entry_point_running_in_container(self): | ||
self.__build_image(docker_file=build_file, tag=image_tag, cwd=repo_root_dir) |
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.
Unless we want to expose tag
as a parameter of IntegrationTest
in the future, I don't think we need to pass around tag
in this script, we can always use image_tag
.
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.
Done.
|
|
In this PR:
generate_repo.py
andgenerate_pr_description.py
in docker container.Context:
In this log, the nightly generation job only took 3 mins. After investigation, we found out that removing
main
method ingenerate_repo.py
(#2598) caused the CLI is not running despite that the job returns successfully.This non-explicit failure demonstrated that there's difference between calling CLI (
generate
method ingenerate_repo.py
) and its implementation (generate_from_yaml
method ingenerate_repo.py
).We decided to change the integration test to run the CLI in docker container, rather than testing
generate_from_yaml
because it is the containerized CLI will be used in downstream libraries.