Skip to content

Commit 56b13bb

Browse files
authored
Merge pull request #3292 from buildkite/ming/te-3708
TE-3708: use bktec on agent
2 parents fb88177 + 4dcbadb commit 56b13bb

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

.buildkite/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ services:
1313
environment:
1414
- GOCACHE=/gocache
1515
- GOMODCACHE=/gomodcache
16-
16+
1717
agent:
1818
build:
1919
context: .
@@ -30,6 +30,7 @@ services:
3030
- "BUILDKITE_BUILD_PATH=/buildkite"
3131
- GOCACHE=/gocache
3232
- GOMODCACHE=/gomodcache
33+
- BUILDKITE_TEST_ENGINE_API_ACCESS_TOKEN
3334

3435
ruby:
3536
image: ruby:2.7.6

.buildkite/pipeline.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ steps:
2222
- name: ":linux: Linux AMD64 Tests"
2323
key: test-linux-amd64
2424
command: ".buildkite/steps/tests.sh"
25+
parallelism: 2
2526
artifact_paths: junit-*.xml
2627
plugins:
2728
- docker-compose#v4.14.0:
2829
config: .buildkite/docker-compose.yml
2930
cli-version: 2
31+
propagate-environment: true
3032
run: agent
3133
- test-collector#v1.2.0:
3234
files: "junit-*.xml"
@@ -37,13 +39,15 @@ steps:
3739
- name: ":linux: Linux ARM64 Tests"
3840
key: test-linux-arm64
3941
command: ".buildkite/steps/tests.sh"
42+
parallelism: 2
4043
artifact_paths: junit-*.xml
4144
agents:
4245
queue: $AGENT_RUNNERS_LINUX_ARM64_QUEUE
4346
plugins:
4447
- docker-compose#v4.14.0:
4548
config: .buildkite/docker-compose.yml
4649
cli-version: 2
50+
propagate-environment: true
4751
run: agent
4852
- test-collector#v1.2.0:
4953
files: "junit-*.xml"
@@ -54,13 +58,16 @@ steps:
5458
- name: ":satellite: Detect Data Races"
5559
key: test-race-linux-arm64
5660
command: ".buildkite/steps/tests.sh -race"
61+
# Extra parallelism because this data race test is slow
62+
parallelism: 3
5763
artifact_paths: junit-*.xml
5864
agents:
5965
queue: $AGENT_RUNNERS_LINUX_ARM64_QUEUE
6066
plugins:
6167
- docker-compose#v4.14.0:
6268
config: .buildkite/docker-compose.yml
6369
cli-version: 2
70+
propagate-environment: true
6471
run: agent
6572
- test-collector#v1.2.0:
6673
files: "junit-*.xml"
@@ -71,6 +78,7 @@ steps:
7178
- name: ":windows: Windows AMD64 Tests"
7279
key: test-windows
7380
command: "bash .buildkite\\steps\\tests.sh"
81+
parallelism: 2
7482
artifact_paths: junit-*.xml
7583
agents:
7684
queue: $AGENT_RUNNERS_WINDOWS_QUEUE

.buildkite/steps/tests.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,16 @@ echo arch is "$(uname -m)"
66

77
go install gotest.tools/gotestsum@v1.8.0
88

9+
go install github.com/buildkite/test-engine-client@v1.5.0-rc.3
10+
911
echo '+++ Running tests'
10-
gotestsum --junitfile "junit-${BUILDKITE_JOB_ID}.xml" -- -count=1 -coverprofile=cover.out -failfast "$@" ./...
12+
export BUILDKITE_TEST_ENGINE_SUITE_SLUG=buildkite-agent
13+
export BUILDKITE_TEST_ENGINE_TEST_RUNNER=gotest
14+
export BUILDKITE_TEST_ENGINE_RESULT_PATH="junit-${BUILDKITE_JOB_ID}.xml"
15+
export BUILDKITE_TEST_ENGINE_RETRY_COUNT=1
16+
export BUILDKITE_TEST_ENGINE_TEST_CMD="gotestsum --junitfile={{resultPath}} -- -count=1 -coverprofile=cover.out $@ {{packages}}"
17+
18+
test-engine-client
1119

1220
echo 'Producing coverage report'
1321
go tool cover -html cover.out -o cover.html

0 commit comments

Comments
 (0)