feat(librariangen): implement the build command#12817
Merged
jskeet merged 2 commits intogoogleapis:mainfrom Sep 8, 2025
Merged
feat(librariangen): implement the build command#12817jskeet merged 2 commits intogoogleapis:mainfrom
jskeet merged 2 commits intogoogleapis:mainfrom
Conversation
This assumes: - All modules have at least one test file (may not be true for things like orgpolicy which are just generated from protos, no GAPIC) - It's okay to just run `go test ./...` without worrying about integration tests Additionally, it *may* be worth just running `go test` without the build part first; it's unclear to me whether that could lead to confusion though. Thoughts welcome.
codyoss
reviewed
Sep 5, 2025
| // goTest builds all the code under the specified directory | ||
| func goTest(ctx context.Context, dir, module string) error { | ||
| slog.Info("librariangen: testing", "module", module) | ||
| args := []string{"go", "test", "./..."} |
Member
There was a problem hiding this comment.
nit: add -short flag to this command. This will exclude integration tests that expect creds.
Contributor
Author
There was a problem hiding this comment.
Aha, great! That'll require tweaking the tests a bit... I'll do it first thing on Monday morning.
Contributor
Author
There was a problem hiding this comment.
Done in a new commit. (Also fixed some test issues - and I've raised googleapis/librarian#1960 to suggest using ContinueOnError for flag parsing errors, so we can test them.)
codyoss
approved these changes
Sep 8, 2025
quartzmo
pushed a commit
that referenced
this pull request
Sep 22, 2025
🤖 I have created a release *beep* *boop* --- ## [0.123.0](v0.122.0...v0.123.0) (2025-09-18) ### Features * **internal/stategen:** Populate the latest googleapis commit ([#12880](#12880)) ([7b017a0](7b017a0)) * **librariangen:** Implement the build command ([#12817](#12817)) ([14734c8](14734c8)) ### Bug Fixes * **internal/librariangen:** Add link to source commit in release notes ([#12881](#12881)) ([1c06cc6](1c06cc6)) * **internal/librariangen:** Fix CHANGES.md headers ([#12849](#12849)) ([baf515d](baf515d)) * **internal/librariangen:** Remove go mod init/tidy from postprocessor ([#12832](#12832)) ([1fe506a](1fe506a)) * **internal/librariangen:** Test for error path with flags ([#12830](#12830)) ([f0da7b2](f0da7b2)) * **internal/postprocessor:** Add dlp to skip-module-scan-paths ([#12857](#12857)) ([45a7d9b](45a7d9b)) * **librariangen:** Honor original container contract ([#12846](#12846)) ([71c8fd3](71c8fd3)) * **librariangen:** Improvements to release-init ([#12842](#12842)) ([0db677a](0db677a)) * **stategen:** Specify an appropriate tag format for google-cloud-go ([#12835](#12835)) ([ffcff33](ffcff33)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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.
This assumes:
go test ./...without worrying about integration testsAdditionally, it may be worth just running
go testwithout the build part first; it's unclear to me whether that could lead to confusion though. Thoughts welcome.