Skip to content

Commit

Permalink
include mysql cred
Browse files Browse the repository at this point in the history
  • Loading branch information
nasir19noor committed Jan 15, 2025
1 parent c5b8103 commit c6278b5
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 63 deletions.
143 changes: 83 additions & 60 deletions cicd/cmd/run-it-tests/main.go
Original file line number Diff line number Diff line change
@@ -1,62 +1,85 @@
package main
/*
* Copyright (C) 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

import (
"flag"
"log"
package main

"github.com/GoogleCloudPlatform/DataflowTemplates/cicd/internal/flags"
"github.com/GoogleCloudPlatform/DataflowTemplates/cicd/internal/workflows"
)

func main() {
flags.RegisterCommonFlags()
flags.RegisterItFlags()
flag.Parse()

// Run mvn install first to ensure all dependencies are available
mvnFlags := workflows.NewMavenFlags()
err := workflows.MvnCleanInstall().Run(
mvnFlags.IncludeDependencies(),
mvnFlags.IncludeDependents(),
mvnFlags.SkipDependencyAnalysis(),
mvnFlags.SkipCheckstyle(),
mvnFlags.SkipJib(),
mvnFlags.SkipTests(),
mvnFlags.SkipJacoco(),
mvnFlags.SkipShade(),
mvnFlags.ThreadCount(8),
mvnFlags.InternalMaven())
if err != nil {
log.Fatalf("%v\n", err)
}

// Run only Spanner-specific integration tests
mvnFlags = workflows.NewMavenFlags()
err = workflows.MvnVerify().Run(
mvnFlags.IncludeDependencies(),
mvnFlags.IncludeDependents(),
mvnFlags.SkipDependencyAnalysis(),
mvnFlags.SkipCheckstyle(),
mvnFlags.SkipJib(),
mvnFlags.SkipShade(),
mvnFlags.RunIntegrationTests(flags.UnifiedWorkerHarnessContainerImage() != ""),
mvnFlags.ThreadCount(4),
mvnFlags.IntegrationTestParallelism(3),
// Only include Spanner instance configuration
mvnFlags.StaticSpannerInstance("spanner-demo"),
mvnFlags.InternalMaven(),
flags.Region(),
flags.Project(),
flags.ArtifactBucket(),
flags.StageBucket(),
flags.HostIp(),
flags.PrivateConnectivity(),
flags.SpannerHost(),
flags.FailureMode(),
flags.RetryFailures(),
flags.UnifiedWorkerHarnessContainerImage())
if err != nil {
log.Fatalf("%v\n", err)
}
log.Println("Build and Spanner Integration Tests Successful!")
}
import (
"flag"
"log"

"github.com/GoogleCloudPlatform/DataflowTemplates/cicd/internal/flags"
"github.com/GoogleCloudPlatform/DataflowTemplates/cicd/internal/workflows"
)

func main() {
flags.RegisterCommonFlags()
flags.RegisterItFlags()
flag.Parse()

// Run mvn install before running integration tests
mvnFlags := workflows.NewMavenFlags()
err := workflows.MvnCleanInstall().Run(
mvnFlags.IncludeDependencies(),
mvnFlags.IncludeDependents(),
mvnFlags.SkipDependencyAnalysis(),
mvnFlags.SkipCheckstyle(),
mvnFlags.SkipJib(),
mvnFlags.SkipTests(),
mvnFlags.SkipJacoco(),
mvnFlags.SkipShade(),
mvnFlags.ThreadCount(8),
mvnFlags.InternalMaven())
if err != nil {
log.Fatalf("%v\n", err)
}

// Run integration tests
mvnFlags = workflows.NewMavenFlags()
err = workflows.MvnVerify().Run(
mvnFlags.IncludeDependencies(),
mvnFlags.IncludeDependents(),
mvnFlags.SkipDependencyAnalysis(),
mvnFlags.SkipCheckstyle(),
mvnFlags.SkipJib(),
mvnFlags.SkipShade(),
mvnFlags.RunIntegrationTests(flags.UnifiedWorkerHarnessContainerImage() != ""),
mvnFlags.ThreadCount(4),
mvnFlags.IntegrationTestParallelism(3),
mvnFlags.StaticBigtableInstance("teleport"),
mvnFlags.StaticSpannerInstance("teleport"),
mvnFlags.InternalMaven(),
flags.Region(),
flags.Project(),
flags.ArtifactBucket(),
flags.StageBucket(),
flags.HostIp(),
flags.PrivateConnectivity(),
flags.SpannerHost(),
flags.FailureMode(),
flags.RetryFailures(),
// flags.StaticOracleHost(),
// flags.StaticOracleSysPassword(),
flags.CloudProxyHost(),
flags.CloudProxyMySqlPort(),
// flags.CloudProxyPostgresPort(),
flags.CloudProxyPassword(),
flags.UnifiedWorkerHarnessContainerImage(),
flags.CloudProxyPassword())
if err != nil {
log.Fatalf("%v\n", err)
}
log.Println("Build Successful!")
}
6 changes: 3 additions & 3 deletions cicd/internal/flags/it-flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ func RegisterItFlags() {
flag.StringVar(&dSpannerHost, "it-spanner-host", "", "(optional) A custom endpoint to override Spanner API requests")
flag.BoolVar(&dReleaseMode, "it-release", false, "(optional) Set if tests are being executed for a release")
flag.StringVar(&dRetryFailures, "it-retry-failures", "0", "Number of retries attempts for failing tests")
flag.StringVar(&dCloudProxyHost, "it-cloud-proxy-host", "10.128.0.34", "Hostname or IP address of static Cloud Auth Proxy")
flag.StringVar(&dCloudProxyMySqlPort, "it-cloud-proxy-mysql-port", "33134", "MySql port number on static Cloud Auth Proxy")
flag.StringVar(&dCloudProxyHost, "it-cloud-proxy-host", "34.93.18.144", "Hostname or IP address of static Cloud Auth Proxy")
flag.StringVar(&dCloudProxyMySqlPort, "it-cloud-proxy-mysql-port", "3306", "MySql port number on static Cloud Auth Proxy")
flag.StringVar(&dCloudProxyPostgresPort, "it-cloud-proxy-postgres-port", "33136", "Postgres port number on static Cloud Auth Proxy")
flag.StringVar(&dCloudProxyPassword, "it-cloud-proxy-password", "t>5xl%J(&qTK6?FaZ", "Password of static Cloud Auth Proxy")
flag.StringVar(&dCloudProxyPassword, "it-cloud-proxy-password", "test", "Password of static Cloud Auth Proxy")
flag.StringVar(&dOracleHost, "it-oracle-host", "10.128.0.90", "Hostname or IP address of static Oracle DB")
flag.StringVar(&dCloudOracleSysPassword, "it-oracle-sys-password", "oracle", "sys password of static Oracle DB")
flag.StringVar(&dUnifiedWorkerHarnessContainerImage, "it-unified-worker-harness-container-image", "", "Runner harness image to run tests against")
Expand Down

0 comments on commit c6278b5

Please sign in to comment.