Skip to content

Commit cae60ca

Browse files
committed
single out OpentelemetryTestSuite
Signed-off-by: TJ Zhang <[email protected]>
1 parent 0ffe8fe commit cae60ca

File tree

4 files changed

+88
-1
lines changed

4 files changed

+88
-1
lines changed

.github/workflows/go.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,3 +372,64 @@ jobs:
372372
utils/clusters/**
373373
benchmarks/results/**
374374
go/reports/**
375+
376+
test-opentelemetry:
377+
name: Go OpenTelemetry Tests - ${{ matrix.go }}, EngineVersion - ${{ matrix.engine.version }}, Target - ${{ matrix.host.TARGET }}
378+
needs: get-matrices
379+
timeout-minutes: 35
380+
strategy:
381+
fail-fast: false
382+
matrix:
383+
go: ${{ fromJson(needs.get-matrices.outputs.version-matrix-output) }}
384+
engine: ${{ fromJson(needs.get-matrices.outputs.engine-matrix-output) }}
385+
host: ${{ fromJson(needs.get-matrices.outputs.host-matrix-output) }}
386+
runs-on: ${{ matrix.host.RUNNER }}
387+
388+
steps:
389+
- uses: actions/checkout@v4
390+
391+
- name: Output Matrix Parameters for this job
392+
run: |
393+
echo "Job running with the following matrix configuration:"
394+
echo "${{ toJson(matrix) }}"
395+
396+
- name: Set up Go ${{ matrix.go }}
397+
uses: actions/setup-go@v5
398+
with:
399+
go-version: ${{ matrix.go }}
400+
cache-dependency-path: go/go.sum
401+
402+
- name: Install shared software dependencies
403+
uses: ./.github/workflows/install-shared-dependencies
404+
with:
405+
os: ${{ matrix.host.OS }}
406+
target: ${{ matrix.host.TARGET }}
407+
github-token: ${{ secrets.GITHUB_TOKEN }}
408+
engine-version: ${{ matrix.engine.version }}
409+
410+
- uses: actions/cache@v4
411+
with:
412+
path: |
413+
ffi/target
414+
glide-core/src/generated
415+
key: ${{ matrix.host.TARGET }}-go
416+
restore-keys: |
417+
${{ matrix.host.TARGET }}-glide-core
418+
${{ matrix.host.TARGET }}
419+
420+
- name: Install & build & test
421+
working-directory: go
422+
run: |
423+
make install-tools build
424+
make -k opentelemetry-test test-filter=TestOpenTelemetry
425+
426+
- name: Upload logs and reports
427+
if: always()
428+
continue-on-error: true
429+
uses: actions/upload-artifact@v4
430+
with:
431+
name: test-report-go-opentelemetry-${{ matrix.go }}-${{ matrix.engine.type }}-${{ matrix.engine.version }}-${{ matrix.host.RUNNER }}
432+
path: |
433+
utils/clusters/**
434+
benchmarks/results/**
435+
go/reports/**

go/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ example-test:
152152
| go-test-report -o reports/example-tests.html -t example-test > /dev/null)
153153

154154
# integration tests - run subtask with skipping modules tests
155-
integ-test: export TEST_FILTER = -skip TestGlideTestSuite/TestModule $(if $(test-filter), -testify.m $(test-filter))
155+
integ-test: export TEST_FILTER = -skip TestGlideTestSuite/TestModule -skip TestOpenTelemetryTestSuite $(if $(test-filter), -testify.m $(test-filter))
156156
integ-test: __it
157157

158158
# modules tests - run substask with default filter
@@ -167,6 +167,10 @@ pubsub-test: __it
167167
long-timeout-test: export TEST_FILTER = -skip TestGlideTestSuite/TestModule -long-timeout-tests $(if $(test-filter), -testify.m $(test-filter))
168168
long-timeout-test: __it
169169

170+
# opentelemetry tests - run subtask with the opentelemetry flag enabled
171+
opentelemetry-test: export TEST_FILTER = -skip TestGlideTestSuite/TestModule -otel-test $(if $(test-filter), -testify.m $(test-filter))
172+
opentelemetry-test: __it
173+
170174
__it:
171175
mkdir -p reports
172176
set -o pipefail; \

go/integTest/glide_test_suite_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ var (
6060
)
6161
pubsubtest = flag.Bool("pubsub", false, "Set to true to run pubsub tests")
6262
longTimeoutTests = flag.Bool("long-timeout-tests", false, "Set to true to run tests with longer timeouts")
63+
otelTest = flag.Bool("otel-test", false, "Set to true to run opentelemetry tests")
6364
)
6465

6566
func (suite *GlideTestSuite) SetupSuite() {

go/integTest/opentelemetry_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ func readAndParseSpanFile(path string) (SpanFileData, error) {
188188
}
189189

190190
func (suite *OpenTelemetryTestSuite) TestOpenTelemetry_AutomaticSpanLifecycle() {
191+
if !*otelTest {
192+
suite.T().Skip("OpenTelemetry tests are disabled")
193+
}
191194
suite.runWithSpecificClients(ClientTypeFlag(StandaloneFlag), func(client interfaces.BaseClientCommands) {
192195
// Force garbage collection
193196
runtime.GC()
@@ -216,6 +219,9 @@ func (suite *OpenTelemetryTestSuite) TestOpenTelemetry_AutomaticSpanLifecycle()
216219
}
217220

218221
func (suite *OpenTelemetryTestSuite) TestOpenTelemetry_GlobalConfigNotReinitialize() {
222+
if !*otelTest {
223+
suite.T().Skip("OpenTelemetry tests are disabled")
224+
}
219225
suite.runWithSpecificClients(ClientTypeFlag(StandaloneFlag), func(client interfaces.BaseClientCommands) {
220226
// Try to initialize OpenTelemetry with wrong endpoint
221227
wrongConfig := glide.OpenTelemetryConfig{
@@ -244,6 +250,9 @@ func (suite *OpenTelemetryTestSuite) TestOpenTelemetry_GlobalConfigNotReinitiali
244250
}
245251

246252
func (suite *OpenTelemetryTestSuite) TestOpenTelemetry_ConcurrentCommandsSpanLifecycle() {
253+
if !*otelTest {
254+
suite.T().Skip("OpenTelemetry tests are disabled")
255+
}
247256
suite.runWithSpecificClients(ClientTypeFlag(StandaloneFlag), func(client interfaces.BaseClientCommands) {
248257
// Force garbage collection
249258
runtime.GC()
@@ -304,6 +313,9 @@ func (suite *OpenTelemetryTestSuite) TestOpenTelemetry_ConcurrentCommandsSpanLif
304313

305314
// cluster tests
306315
func (suite *OpenTelemetryTestSuite) TestOpenTelemetry_ClusterClientMemoryLeak() {
316+
if !*otelTest {
317+
suite.T().Skip("OpenTelemetry tests are disabled")
318+
}
307319
suite.runWithSpecificClients(ClientTypeFlag(ClusterFlag), func(client interfaces.BaseClientCommands) {
308320
// Force garbage collection
309321
runtime.GC()
@@ -336,6 +348,9 @@ func (suite *OpenTelemetryTestSuite) TestOpenTelemetry_ClusterClientMemoryLeak()
336348
}
337349

338350
func (suite *OpenTelemetryTestSuite) TestOpenTelemetry_ClusterClientSamplingPercentage() {
351+
if !*otelTest {
352+
suite.T().Skip("OpenTelemetry tests are disabled")
353+
}
339354
suite.runWithSpecificClients(ClientTypeFlag(ClusterFlag), func(client interfaces.BaseClientCommands) {
340355
// Set sampling percentage to 0
341356
err := glide.GetInstance().SetSamplePercentage(0)
@@ -396,6 +411,9 @@ func (suite *OpenTelemetryTestSuite) TestOpenTelemetry_ClusterClientSamplingPerc
396411
}
397412

398413
func (suite *OpenTelemetryTestSuite) TestOpenTelemetry_ClusterClientGlobalConfigNotReinitialize() {
414+
if !*otelTest {
415+
suite.T().Skip("OpenTelemetry tests are disabled")
416+
}
399417
suite.runWithSpecificClients(ClientTypeFlag(ClusterFlag), func(client interfaces.BaseClientCommands) {
400418
// Try to initialize OpenTelemetry with wrong endpoint
401419
wrongConfig := glide.OpenTelemetryConfig{
@@ -424,6 +442,9 @@ func (suite *OpenTelemetryTestSuite) TestOpenTelemetry_ClusterClientGlobalConfig
424442
}
425443

426444
func (suite *OpenTelemetryTestSuite) TestOpenTelemetry_ClusterClientMultipleClients() {
445+
if !*otelTest {
446+
suite.T().Skip("OpenTelemetry tests are disabled")
447+
}
427448
suite.runWithSpecificClients(ClientTypeFlag(ClusterFlag), func(client1 interfaces.BaseClientCommands) {
428449
// Create a second client with the same configuration
429450
client2 := suite.clusterClient(suite.defaultClusterClientConfig())

0 commit comments

Comments
 (0)