Skip to content
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: remove generated files in tests #2644

Merged
merged 19 commits into from
Apr 19, 2024
Merged

Conversation

JoeWang1127
Copy link
Collaborator

@JoeWang1127 JoeWang1127 commented Apr 16, 2024

In this PR:

  • Remove generated files after running tests.

Note that files generated by docker run have root permission, thus can't be removed by this PR. This issue will be resolved in #2615.

@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Apr 16, 2024
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Apr 16, 2024
.gitignore Outdated Show resolved Hide resolved
@JoeWang1127 JoeWang1127 requested a review from blakeli0 April 16, 2024 22:40
@JoeWang1127 JoeWang1127 marked this pull request as ready for review April 16, 2024 22:40
@JoeWang1127 JoeWang1127 requested a review from a team as a code owner April 16, 2024 22:40
@JoeWang1127 JoeWang1127 added the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 16, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 16, 2024
@JoeWang1127 JoeWang1127 requested a review from blakeli0 April 17, 2024 16:44
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Apr 18, 2024
@@ -373,6 +375,7 @@ def test_prepare_repo_split_repo_success(self):
self.assertEqual("output", Path(repo_config.output_folder).name)
library_path = sorted([Path(key).name for key in repo_config.libraries])
self.assertEqual(["misc"], library_path)
shutil.rmtree(repo_config.output_folder, ignore_errors=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we can not use __remove_generated_files here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__remove_generated_files is used to delete .repo-metadata.json, .OwlBot-hermetic.yaml and owlbot.py and I changed the method name to __remove_prerequisite_files.

@@ -168,6 +175,7 @@ def test_entry_point_running_in_container(self):
"The generated PR description does not match the expected golden file",
)
print(" PR description comparison succeed.")
self.__remove_generated_files()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the generated files after the integration test succeeds.

Copy link

Quality Gate Passed Quality Gate passed for 'gapic-generator-java-root'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@JoeWang1127 JoeWang1127 merged commit d42500f into main Apr 19, 2024
43 checks passed
@JoeWang1127 JoeWang1127 deleted the chore/update-integration-test branch April 19, 2024 11:54
lqiu96 pushed a commit that referenced this pull request May 22, 2024
In this PR:
- Remove generated files after running tests.

Note that files generated by `docker run` have root permission, thus
can't be removed by this PR. This issue will be resolved in #2615.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants