chore: re-work generating unit golden files#912
Merged
chanseokoh merged 3 commits intomainfrom Jan 27, 2022
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## main #912 +/- ##
=======================================
Coverage 87.84% 87.84%
=======================================
Files 153 153
Lines 16046 16046
Branches 1166 1166
=======================================
Hits 14095 14095
Misses 1607 1607
Partials 344 344 Continue to review full report at Codecov.
|
meltsufin
approved these changes
Jan 27, 2022
chanseokoh
commented
Jan 27, 2022
| # Generate the goldens from tests. | ||
| generate_goldens_script = """ | ||
| mkdir local_tmp | ||
| TEST_OUTPUT_HOME="$(pwd)/local_tmp" {test_runner_path} $@ |
Contributor
Author
There was a problem hiding this comment.
FTR: this is the line running SingleJUnitTestRunner.
{test_runner_path} $@ is roughly
java -cp ... com.google.api.generator.test.framework.SingleJUnitTestRunner <SomeUnitTestClass>as shown here. All it does is to run unit tests (i.e., @Test methods) in <SomeUnitTestClass>. (Unit tests in the class should be designed to save a golden file.)
suztomo
pushed a commit
that referenced
this pull request
Dec 16, 2022
* chore: re-work generating unit goldens * chore: clean up code
suztomo
pushed a commit
that referenced
this pull request
Mar 21, 2023
suztomo
pushed a commit
that referenced
this pull request
Mar 21, 2023
🤖 I have created a release *beep* *boop* --- ## [2.8.11](googleapis/java-core@v2.8.10...v2.8.11) (2022-09-08) ### Dependencies * Update dependency com.google.auth:google-auth-library-bom to v1.11.0 ([#911](googleapis/java-core#911)) ([e7d4513](googleapis/java-core@e7d4513)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Now we can completely remove the
rules_bazelfolder.To generate a golden file, all we have to do is to run a unit test, because those unit tests are written to generate and save a golden. For example,
I think this is better than my previous attempt: #911