Skip to content

Commit 07e3763

Browse files
authored
Add junit reports to e2e (#183)
1 parent eb6a674 commit 07e3763

File tree

11 files changed

+31
-33
lines changed

11 files changed

+31
-33
lines changed

.evergreen.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ functions:
7979
MCLI_PRIVATE_API_KEY: ${atlas_private_api_key}
8080
MCLI_PUBLIC_API_KEY: ${atlas_public_api_key}
8181
MCLI_SERVICE: cloud
82+
E2E_CMD: gotestsum --junitfile e2e-tests.xml --
83+
E2E_TAGS: e2e,atlas
8284
<<: *go_options
83-
command: make e2e-test-atlas
85+
command: make e2e-test
8486
"cloud manager e2e":
8587
- command: subprocess.exec
8688
type: test
@@ -96,8 +98,10 @@ functions:
9698
MCLI_PRIVATE_API_KEY: ${cloud_manager_private_api_key}
9799
MCLI_PUBLIC_API_KEY: ${cloud_manager_public_api_key}
98100
MCLI_SERVICE: cloud-manager
101+
E2E_CMD: gotestsum --junitfile e2e-tests.xml --
102+
E2E_TAGS: e2e,cloudmanager
99103
<<: *go_options
100-
command: make e2e-test-cloud
104+
command: make e2e-test
101105
"lint":
102106
- command: shell.exec
103107
type: test
@@ -382,15 +386,23 @@ tasks:
382386
- func: "lint"
383387
- name: atlas_e2e
384388
tags: ["e2e"]
389+
depends_on:
390+
- name: compile
391+
variant: "code_health"
392+
patch_optional: true
385393
commands:
386394
- func: "clone"
387-
- func: "build"
395+
- func: "install gotestsum"
388396
- func: "atlas e2e"
389397
- name: cloud_manager_e2e
390398
tags: ["e2e"]
399+
depends_on:
400+
- name: compile
401+
variant: "code_health"
402+
patch_optional: true
391403
commands:
392404
- func: "clone"
393-
- func: "build"
405+
- func: "install gotestsum"
394406
- func: "cloud manager e2e"
395407
- name: package_msi
396408
tags: ["packaging"]
@@ -952,9 +964,7 @@ buildvariants:
952964
go_root: "/opt/golang/go1.14"
953965
go_bin: "/opt/golang/go1.14/bin"
954966
tasks:
955-
- name: compile
956-
- name: unit_test
957-
- name: lint
967+
- name: .code_health
958968
- name: e2e
959969
display_name: "E2E"
960970
run_on:
@@ -963,8 +973,7 @@ buildvariants:
963973
go_root: "/opt/golang/go1.14"
964974
go_bin: "/opt/golang/go1.14/bin"
965975
tasks:
966-
- name: atlas_e2e
967-
- name: cloud_manager_e2e
976+
- name: .e2e
968977
- name: goreleaser_snaphot
969978
display_name: "Packaging and Publishing (goreleaser, apt, yum)"
970979
run_on:

Makefile

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ COVERAGE=coverage.out
99
VERSION=$(shell git describe --always --tags)
1010
LINKER_FLAGS=-X github.com/mongodb/mongocli/internal/version.Version=${VERSION}
1111

12+
E2E_CMD?=go test
13+
E2E_TAGS?=e2e
14+
1215
export PATH := ./bin:$(PATH)
1316
export GO111MODULE := on
1417

@@ -88,25 +91,11 @@ build: ## Generate a binary in ./bin
8891
@echo "==> Building binary"
8992
go build -ldflags "${LINKER_FLAGS}" -o ${DESTINATION}
9093

91-
.PHONY: e2e-test-atlas
92-
e2e-test-atlas: build ## Run Atlas E2E tests
93-
@echo "==> Running Atlas E2E tests..."
94-
# the target assumes the MCLI-* environment variables are exported
95-
go test -v -p 1 -parallel 1 -tags=e2e ./e2e/atlas...
96-
go test -v -p 1 -parallel 1 -tags=e2e ./e2e/iam...
97-
98-
.PHONY: e2e-test-cloud
99-
e2e-test-cloud: build ## Run IAM E2E tests
100-
@echo "==> Running Cloud Manger E2E tests..."
101-
# the target assumes the MCLI-* environment variables are exported
102-
go test -v -p 1 -parallel 1 -tags=e2e ./e2e/cloud_manager...
103-
go test -v -p 1 -parallel 1 -tags=e2e ./e2e/iam...
104-
10594
.PHONY: e2e-test
10695
e2e-test: build ## Run E2E tests
10796
@echo "==> Running E2E tests..."
10897
# the target assumes the MCLI-* environment variables are exported
109-
go test -v -p 1 -parallel 1 -tags=e2e ./e2e...
98+
$(E2E_CMD) -v -p 1 -parallel 1 -tags="$(E2E_TAGS)" ./e2e...
11099

111100
.PHONY: install
112101
install: ## Install a binary in $GOPATH/bin

e2e/atlas/alertconfig_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
// +build e2e
14+
// +build e2e,atlas
1515

1616
package atlas_test
1717

e2e/atlas/alerts_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
// +build e2e
14+
// +build e2e,atlas
1515

1616
package atlas_test
1717

e2e/atlas/clusters_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
// +build e2e
14+
// +build e2e,atlas
1515

1616
package atlas_test
1717

e2e/atlas/dbusers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
// +build e2e
14+
// +build e2e,atlas
1515

1616
package atlas_test
1717

e2e/atlas/events_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
// +build e2e
14+
// +build e2e,atlas
1515

1616
package atlas_test
1717

e2e/atlas/whitelist_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
// +build e2e
14+
// +build e2e,atlas
1515

1616
package atlas_test
1717

e2e/cloud_manager/alerts_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
// +build e2e
14+
// +build e2e,cloudmanager
1515

1616
package cloud_manager_test
1717

e2e/cloud_manager/dbusers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
// +build e2e
14+
// +build e2e,cloudmanager
1515

1616
package cloud_manager_test
1717

e2e/cloud_manager/events_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
// +build e2e
14+
// +build e2e,cloudmanager
1515

1616
package cloud_manager_test
1717

0 commit comments

Comments
 (0)