Skip to content

Commit

Permalink
Refactor to include Java PR
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Kinard <[email protected]>
  • Loading branch information
Polber committed Sep 20, 2024
1 parent e82a9e6 commit 19ada0c
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 24 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ jobs:
id: setup-env
uses: ./.github/actions/setup-env
- name: Run Build
run: ./cicd/run-build --internal-maven=true
run: ./cicd/run-build
- name: Run Unit Tests
run: ./cicd/run-unit-tests --internal-maven=true
run: ./cicd/run-unit-tests
# TODO(https://github.com/GoogleCloudPlatform/DataflowTemplates/issues/1807) - Remove once Staging Spanner tests
# are fixed
- name: Run Integration Smoke Tests
Expand All @@ -88,8 +88,7 @@ jobs:
--it-private-connectivity="datastream-private-connect-us-central1" \
--it-spanner-host="https://batch-spanner.googleapis.com" \
--it-release=true \
--it-retry-failures=2 \
--internal-maven=true
--it-retry-failures=2
# TODO(https://github.com/GoogleCloudPlatform/DataflowTemplates/issues/1807) - Remove once Staging Spanner tests
# are fixed
- name: Run Integration Tests
Expand All @@ -101,8 +100,7 @@ jobs:
--it-private-connectivity="datastream-private-connect-us-central1" \
--it-spanner-host="https://batch-spanner.googleapis.com" \
--it-release=true \
--it-retry-failures=2 \
--internal-maven=true
--it-retry-failures=2
- name: Upload Site Report
uses: ./.github/actions/publish-site-report
with:
Expand Down
2 changes: 1 addition & 1 deletion cicd/cmd/run-build/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func main() {
mvnFlags.SkipSpotlessCheck(),
mvnFlags.SkipTests(),
mvnFlags.ThreadCount(3),
flags.InternalMaven())
mvnFlags.InternalMaven())
if err != nil {
log.Fatalf("%v\n", err)
}
Expand Down
6 changes: 3 additions & 3 deletions cicd/cmd/run-it-smoke-tests/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func main() {
mvnFlags.SkipJacoco(),
mvnFlags.SkipShade(),
mvnFlags.ThreadCount(8),
flags.InternalMaven())
mvnFlags.InternalMaven())
if err != nil {
log.Fatalf("%v\n", err)
}
Expand All @@ -60,6 +60,7 @@ func main() {
mvnFlags.IntegrationTestParallelism(4),
mvnFlags.StaticBigtableInstance("teleport"),
mvnFlags.StaticSpannerInstance("teleport"),
mvnFlags.InternalMaven(),
flags.Region(),
flags.Project(),
flags.ArtifactBucket(),
Expand All @@ -73,8 +74,7 @@ func main() {
flags.CloudProxyHost(),
flags.CloudProxyMySqlPort(),
flags.CloudProxyPostgresPort(),
flags.CloudProxyPassword(),
flags.InternalMaven())
flags.CloudProxyPassword())
if err != nil {
log.Fatalf("%v\n", err)
}
Expand Down
6 changes: 3 additions & 3 deletions cicd/cmd/run-it-tests/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func main() {
mvnFlags.SkipJacoco(),
mvnFlags.SkipShade(),
mvnFlags.ThreadCount(8),
flags.InternalMaven())
mvnFlags.InternalMaven())
if err != nil {
log.Fatalf("%v\n", err)
}
Expand All @@ -60,6 +60,7 @@ func main() {
mvnFlags.IntegrationTestParallelism(3),
mvnFlags.StaticBigtableInstance("teleport"),
mvnFlags.StaticSpannerInstance("teleport"),
mvnFlags.InternalMaven(),
flags.Region(),
flags.Project(),
flags.ArtifactBucket(),
Expand All @@ -74,8 +75,7 @@ func main() {
flags.CloudProxyHost(),
flags.CloudProxyMySqlPort(),
flags.CloudProxyPostgresPort(),
flags.CloudProxyPassword(),
flags.InternalMaven())
flags.CloudProxyPassword())
if err != nil {
log.Fatalf("%v\n", err)
}
Expand Down
4 changes: 3 additions & 1 deletion cicd/cmd/run-load-test-observer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ func main() {
mvnFlags.SkipTests(),
mvnFlags.SkipJacoco(),
mvnFlags.SkipShade(),
mvnFlags.ThreadCount(4))
mvnFlags.ThreadCount(4),
mvnFlags.InternalMaven())
if err != nil {
log.Fatalf("%v\n", err)
}
Expand All @@ -58,6 +59,7 @@ func main() {
mvnFlags.FailAtTheEnd(),
mvnFlags.RunLoadTestObserver(),
mvnFlags.ThreadCount(4),
mvnFlags.InternalMaven(),
flags.Region(),
flags.Project(),
flags.ArtifactBucket(),
Expand Down
4 changes: 3 additions & 1 deletion cicd/cmd/run-load-tests/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ func main() {
mvnFlags.SkipTests(),
mvnFlags.SkipJacoco(),
mvnFlags.SkipShade(),
mvnFlags.ThreadCount(4))
mvnFlags.ThreadCount(4),
mvnFlags.InternalMaven())
if err != nil {
log.Fatalf("%v\n", err)
}
Expand All @@ -58,6 +59,7 @@ func main() {
mvnFlags.FailAtTheEnd(),
mvnFlags.RunLoadTests(),
mvnFlags.ThreadCount(4),
mvnFlags.InternalMaven(),
flags.Region(),
flags.Project(),
flags.ArtifactBucket(),
Expand Down
2 changes: 1 addition & 1 deletion cicd/cmd/run-unit-tests/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func main() {
mvnFlags.SkipIntegrationTests(),
mvnFlags.FailAtTheEnd(),
mvnFlags.ThreadCount(8),
flags.InternalMaven())
mvnFlags.InternalMaven())
if err != nil {
log.Fatalf("%v\n", err)
}
Expand Down
8 changes: 0 additions & 8 deletions cicd/internal/flags/common-flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ var (
// Registers all common flags. Must be called before flag.Parse().
func RegisterCommonFlags() {
flag.StringVar(&modulesToBuild, "modules-to-build", ALL, "List of modules to build/run commands against")
flag.StringVar(&internalMaven, "internal-maven", "false", "Whether to build using Artifact Registry packages.")
}

// Returns all modules to build.
Expand All @@ -74,10 +73,3 @@ func ModulesToBuild() []string {
}
return strings.Split(m, ",")
}

func InternalMaven() string {
if internalMaven == "true" {
return "-s .mvn/settings.xml"
}
return ""
}
5 changes: 5 additions & 0 deletions cicd/internal/workflows/maven-workflows.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ type MavenFlags interface {
StaticBigtableInstance(string) string
StaticSpannerInstance(string) string
SpannerHost(string) string
InternalMaven() string
}

type mvnFlags struct{}
Expand Down Expand Up @@ -145,6 +146,10 @@ func (*mvnFlags) SpannerHost(host string) string {
return "-DspannerHost=" + host
}

func (*mvnFlags) InternalMaven() string {
return "--settings=.mvn/settings.xml"
}

func NewMavenFlags() MavenFlags {
return &mvnFlags{}
}
Expand Down

0 comments on commit 19ada0c

Please sign in to comment.