Skip to content

Commit 8bdbd82

Browse files
author
Sandeep Mishra
committed
isolation
1 parent bb1f7e8 commit 8bdbd82

File tree

4 files changed

+85
-68
lines changed

4 files changed

+85
-68
lines changed

.github/workflows/spanner-pr.yml

Lines changed: 72 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -54,34 +54,38 @@ env:
5454
permissions: write-all
5555

5656
jobs:
57-
spotless_check:
58-
name: Spotless
59-
timeout-minutes: 10
60-
runs-on: ubuntu-latest
61-
steps:
62-
- name: Checkout Code
63-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
64-
- name: Setup Environment
65-
id: setup-env
66-
uses: ./.github/actions/setup-env
67-
- name: Run Spotless
68-
run: |
69-
./cicd/run-spotless \
70-
--modules-to-build="SPANNER"
71-
checkstyle_check:
72-
name: Checkstyle
73-
timeout-minutes: 10
74-
runs-on: ubuntu-latest
75-
steps:
76-
- name: Checkout Code
77-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
78-
- name: Setup Environment
79-
id: setup-env
80-
uses: ./.github/actions/setup-env
81-
- name: Run Checkstyle
82-
run: |
83-
./cicd/run-checkstyle \
84-
--modules-to-build="SPANNER"
57+
# Temporarily disabled for faster debugging
58+
# spotless_check:
59+
# name: Spotless
60+
# timeout-minutes: 10
61+
# runs-on: ubuntu-latest
62+
# steps:
63+
# - name: Checkout Code
64+
# uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
65+
# - name: Setup Environment
66+
# id: setup-env
67+
# uses: ./.github/actions/setup-env
68+
# - name: Run Spotless
69+
# run: |
70+
# ./cicd/run-spotless \
71+
# --modules-to-build="SPANNER"
72+
73+
# Temporarily disabled for faster debugging
74+
# checkstyle_check:
75+
# name: Checkstyle
76+
# timeout-minutes: 10
77+
# runs-on: ubuntu-latest
78+
# steps:
79+
# - name: Checkout Code
80+
# uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
81+
# - name: Setup Environment
82+
# id: setup-env
83+
# uses: ./.github/actions/setup-env
84+
# - name: Run Checkstyle
85+
# run: |
86+
# ./cicd/run-checkstyle \
87+
# --modules-to-build="SPANNER"
88+
8589
java_build:
8690
name: Build
8791
timeout-minutes: 60
@@ -117,7 +121,7 @@ jobs:
117121
# --modules-to-build="SPANNER"
118122
# - name: Upload Unit Tests Report
119123
# uses: actions/upload-artifact@v4
120-
# if: always() # always run even if the previous step fails
124+
# if: always()
121125
# with:
122126
# name: surefire-unit-test-results
123127
# path: |
@@ -134,44 +138,44 @@ jobs:
134138
# - name: Cleanup Java Environment
135139
# uses: ./.github/actions/cleanup-java-env
136140

137-
java_integration_smoke_tests_templates:
138-
name: Dataflow Templates Integration Smoke Tests
139-
# Updated 'needs' to remove java_unit_tests
140-
needs: [spotless_check, checkstyle_check, java_build]
141-
timeout-minutes: 60
142-
# Run on any runner that matches all the specified runs-on values.
143-
runs-on: [self-hosted, it]
144-
steps:
145-
- name: Checkout Code
146-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
147-
- name: Setup Environment
148-
id: setup-env
149-
uses: ./.github/actions/setup-env
150-
- name: Run Integration Smoke Tests
151-
run: |
152-
./cicd/run-it-smoke-tests \
153-
--modules-to-build="SPANNER" \
154-
--it-region="us-central1" \
155-
--it-project="cloud-teleport-testing" \
156-
--it-artifact-bucket="cloud-teleport-testing-it-gitactions" \
157-
--it-private-connectivity="datastream-connect-2"
158-
- name: Upload Smoke Tests Report
159-
uses: actions/upload-artifact@v4
160-
if: always() # always run even if the previous step fails
161-
with:
162-
name: surefire-smoke-test-results
163-
path: |
164-
**/surefire-reports/TEST-*.xml
165-
**/surefire-reports/*.html
166-
**/surefire-reports/html/**
167-
retention-days: 1
168-
- name: Cleanup Java Environment
169-
uses: ./.github/actions/cleanup-java-env
141+
# Temporarily disabled for faster debugging
142+
# java_integration_smoke_tests_templates:
143+
# name: Dataflow Templates Integration Smoke Tests
144+
# needs: [spotless_check, checkstyle_check, java_build, java_unit_tests]
145+
# timeout-minutes: 60
146+
# runs-on: [self-hosted, it]
147+
# steps:
148+
# - name: Checkout Code
149+
# uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
150+
# - name: Setup Environment
151+
# id: setup-env
152+
# uses: ./.github/actions/setup-env
153+
# - name: Run Integration Smoke Tests
154+
# run: |
155+
# ./cicd/run-it-smoke-tests \
156+
# --modules-to-build="SPANNER" \
157+
# --it-region="us-central1" \
158+
# --it-project="cloud-teleport-testing" \
159+
# --it-artifact-bucket="cloud-teleport-testing-it-gitactions" \
160+
# --it-private-connectivity="datastream-connect-2"
161+
# - name: Upload Smoke Tests Report
162+
# uses: actions/upload-artifact@v4
163+
# if: always()
164+
# with:
165+
# name: surefire-smoke-test-results
166+
# path: |
167+
# **/surefire-reports/TEST-*.xml
168+
# **/surefire-reports/*.html
169+
# **/surefire-reports/html/**
170+
# retention-days: 1
171+
# - name: Cleanup Java Environment
172+
# uses: ./.github/actions/cleanup-java-env
173+
170174
java_integration_tests_templates:
171175
name: Dataflow Templates Integration Tests
172-
needs: [java_integration_smoke_tests_templates]
176+
# Updated dependencies to run directly after build
177+
needs: [java_build]
173178
timeout-minutes: 180
174-
# Run on any runner that matches all the specified runs-on values.
175179
runs-on: [self-hosted, it]
176180
steps:
177181
- name: Checkout Code
@@ -187,10 +191,11 @@ jobs:
187191
--it-project="cloud-teleport-testing" \
188192
--it-artifact-bucket="cloud-teleport-testing-it-gitactions" \
189193
--it-private-connectivity="datastream-connect-2" \
194+
--it-module-to-test="v2/spanner-to-sourcedb" \
190195
--it-test-to-run="SpannerToSourceDbIT"
191196
- name: Upload Integration Tests Report
192197
uses: actions/upload-artifact@v4
193-
if: always() # always run even if the previous step fails
198+
if: always()
194199
with:
195200
name: surefire-integration-test-results
196201
path: |
@@ -215,10 +220,9 @@ jobs:
215220
java_load_tests_templates:
216221
if: contains(github.event.pull_request.labels.*.name, 'run-load-tests')
217222
name: Dataflow Templates Load Tests
218-
# Updated 'needs' to remove java_unit_tests
219-
needs: [spotless_check, checkstyle_check, java_build, java_integration_tests_templates]
223+
# Updated dependencies
224+
needs: [java_build, java_integration_tests_templates]
220225
timeout-minutes: 600
221-
# Run on any runner that matches all the specified runs-on values.
222226
runs-on: [self-hosted, perf]
223227
steps:
224228
- name: Checkout Code

cicd/cmd/run-it-tests/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ func main() {
6969
flags.FailureMode(),
7070
flags.RetryFailures(),
7171
flags.TestToRun(), // ADD THIS LINE TO USE THE NEW FLAG
72+
flags.ModuleToTest(),
7273
flags.StaticOracleHost(),
7374
flags.StaticOracleSysPassword(),
7475
flags.CloudProxyHost(),

cicd/internal/flags/it-flags.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ var (
4343
dIntegrationTestParallelism string
4444
dThreadCount string
4545
dTestToRun string // 1. ADD THIS VARIABLE
46+
dModuleToTest string // 1. ADD THIS VARIABLE
4647
)
4748

4849
// Registers all it flags. Must be called before flag.Parse().
@@ -68,6 +69,7 @@ func RegisterItFlags() {
6869

6970
// 2. ADD THIS FLAG REGISTRATION
7071
flag.StringVar(&dTestToRun, "it-test-to-run", "", "The specific integration test class to run")
72+
flag.StringVar(&dModuleToTest, "it-module-to-test", "", "The specific module to run tests against") // 2. ADD THIS FLAG REGISTRATION
7173
}
7274

7375
func Region() string {
@@ -179,3 +181,13 @@ func TestToRun() string {
179181
}
180182
return ""
181183
}
184+
185+
// 3. ADD THIS ACCESSOR FUNCTION
186+
func ModuleToTest() string {
187+
if dModuleToTest != "" {
188+
// -pl tells Maven to build only this project
189+
// -am tells Maven to also build any dependencies it needs
190+
return "-pl " + dModuleToTest + " -am"
191+
}
192+
return ""
193+
}

cicd/run-it-tests

2.8 MB
Binary file not shown.

0 commit comments

Comments
 (0)