-
Notifications
You must be signed in to change notification settings - Fork 69
chore: re-work generating unit golden files #912
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
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.
|
| # Generate the goldens from tests. | ||
| generate_goldens_script = """ | ||
| mkdir local_tmp | ||
| TEST_OUTPUT_HOME="$(pwd)/local_tmp" {test_runner_path} $@ |
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.
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.)
* chore: re-work generating unit goldens * chore: clean up code
🤖 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).
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