Skip to content

Commit c4ef3d8

Browse files
authored
chore: Seperate E2E tests from unit tests (#28)
* chore: Seperate E2E tests from unit tests This PR seperates the E2E tests from unit tests by using build tags. This change will make sure the setup for E2E tests is not run for the unit tests. * Update e2e_test.go * Update integration.cloudbuild.yaml * Update client_test.go * Update options_test.go * Update protocol_test.go * Update tool_test.go * Update utils_test.go * Update integration.cloudbuild.yaml * Update integration.cloudbuild.yaml
1 parent 4c31d3e commit c4ef3d8

File tree

8 files changed

+28
-2
lines changed

8 files changed

+28
-2
lines changed

core/client_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build unit
2+
13
// Copyright 2025 Google LLC
24
//
35
// Licensed under the Apache License, Version 2.0 (the "License");

core/e2e_setup_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build e2e
2+
13
// Copyright 2025 Google LLC
24
//
35
// Licensed under the Apache License, Version 2.0 (the "License");

core/e2e_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build e2e
2+
13
// Copyright 2025 Google LLC
24
//
35
// Licensed under the Apache License, Version 2.0 (the "License");

core/options_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build unit
2+
13
// Copyright 2025 Google LLC
24
//
35
// Licensed under the Apache License, Version 2.0 (the "License");

core/protocol_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build unit
2+
13
// Copyright 2025 Google LLC
24
//
35
// Licensed under the Apache License, Version 2.0 (the "License");

core/tool_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build unit
2+
13
// Copyright 2025 Google LLC
24
//
35
// Licensed under the Apache License, Version 2.0 (the "License");

core/utils_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build unit
2+
13
// Copyright 2025 Google LLC
24
//
35
// Licensed under the Apache License, Version 2.0 (the "License");

integration.cloudbuild.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,18 @@ steps:
2424
script: |
2525
go get -d ./...
2626
27-
- id: "run-tests"
27+
- id: "run-unit-tests"
28+
name: golang:1
29+
waitFor: ["install-dependencies"]
30+
env:
31+
- "GOPATH=/gopath"
32+
volumes:
33+
- name: "go"
34+
path: "/gopath"
35+
script: |
36+
go test -tags=unit ./... -v -race
37+
38+
- id: "run-e2e-tests"
2839
name: golang:1
2940
waitFor: ["install-dependencies"]
3041
env:
@@ -35,7 +46,8 @@ steps:
3546
- name: "go"
3647
path: "/gopath"
3748
script: |
38-
go test ./... -v -race
49+
go test -tags=e2e ./... -v -race
50+
3951

4052
options:
4153
logging: CLOUD_LOGGING_ONLY

0 commit comments

Comments
 (0)