Skip to content

Commit

Permalink
test Integration Testing -Dtest=SpannerToSourceDbIT
Browse files Browse the repository at this point in the history
  • Loading branch information
nasir19noor committed Jan 18, 2025
1 parent 6f0241d commit 4485e9c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/java-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ jobs:
id: setup-env
uses: ./.github/actions/setup-env
- name: Run Integration Tests
run: mvn clean verify -PtemplatesIntegrationTests -pl v2/spanner-to-sourcedb -am -Dtest=SpannerToSourceDbInterleaveMultiShardIT -Dcheckstyle.skip -Dspotless.check.skip=true -DartifactBucket="ollion-teleport-testing" -Dproject="daring-fiber-439305-v4" -Dregion=asia-south1 -DspannerInstanceId="spanner-demo"
run: mvn clean verify -PtemplatesIntegrationTests -pl v2/spanner-to-sourcedb -am -Dtest=SpannerToSourceDbIT -Dcheckstyle.skip -Dspotless.check.skip=true -DartifactBucket="ollion-teleport-testing" -Dproject="daring-fiber-439305-v4" -Dregion=asia-south1 -DspannerInstanceId="spanner-demo"
# |
# ./cicd/run-it-tests \
# --modules-to-build="v2/spanner-to-sourcedb" \
Expand Down
30 changes: 15 additions & 15 deletions cicd/internal/flags/it-flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func RegisterItFlags() {
flag.StringVar(&dProject, "it-project", "", "The GCP project to run the integration tests in")
flag.StringVar(&dArtifactBucket, "it-artifact-bucket", "", "A GCP bucket to store test artifacts")
flag.StringVar(&dStageBucket, "it-stage-bucket", "", "(optional) A GCP bucket to stage templates")
flag.StringVar(&dHostIp, "it-host-ip", "", "(optional) The ip that the gitactions runner is listening on")
flag.StringVar(&dHostIp, "it-host-ip", "34.47.164.248", "(optional) The ip that the gitactions runner is listening on")
flag.StringVar(&dPrivateConnectivity, "it-private-connectivity", "", "(optional) A GCP private connectivity endpoint")
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")
Expand Down Expand Up @@ -81,26 +81,26 @@ func StageBucket() string {
return "-DstageBucket=" + dStageBucket
}

// func HostIp() string {
// if len(dHostIp) == 0 {
// gcloudCmd := "gcloud compute instances list | grep $(hostname) | awk '{print $4}'"
// if hostIP, err := exec.Command("bash", "-c", gcloudCmd).Output(); err != nil || len(hostIP) == 0 {
// panic(fmt.Errorf("failed to get gitactions runner host ip: %v", err))
// } else {
// return "-DhostIp=" + string(hostIP)[:len(hostIP)-1]
// // return "-DhostIp=34.47.164.248"
// }
// }
// return "-DhostIp=" + dHostIp
// }

func HostIp() string {
if len(dHostIp) == 0 {
return "-DhostIp=34.47.164.248"
gcloudCmd := "gcloud compute instances list | grep $(hostname) | awk '{print $4}'"
if hostIP, err := exec.Command("bash", "-c", gcloudCmd).Output(); err != nil || len(hostIP) == 0 {
panic(fmt.Errorf("failed to get gitactions runner host ip: %v", err))
} else {
return "-DhostIp=" + string(hostIP)[:len(hostIP)-1]
// return "-DhostIp=34.47.164.248"
}
}
return "-DhostIp=" + dHostIp
}

// func HostIp() string {
// if len(dHostIp) == 0 {
// return "-DhostIp=34.47.164.248"
// }
// return "-DhostIp=" + dHostIp
// }

func PrivateConnectivity() string {
if dPrivateConnectivity != "" {
return "-DprivateConnectivity=" + dPrivateConnectivity
Expand Down

0 comments on commit 4485e9c

Please sign in to comment.