Skip to content

Commit 7969667

Browse files
authored
Merge pull request docker#9623 from glours/add-build-and-run-e2e-targets
add new targets to build Compose binary before running e2e tests
2 parents 40063b4 + 978b2f8 commit 7969667

File tree

2 files changed

+48
-3
lines changed

2 files changed

+48
-3
lines changed

BUILDING.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,51 @@ make test
3434

3535
If you need to update a golden file simply do `go test ./... -test.update-golden`.
3636

37-
### End to end tests
37+
### End-to-end tests
38+
To run e2e tests, the Compose CLI binary need to be build. All the commands to run e2e tests propose a version
39+
with the prefix `build-and-e2e` to first build the CLI before executing tests.
3840

39-
To run the end to end tests, run:
41+
42+
Note that this requires a local Docker Engine to be running.
43+
44+
#### Whole end-to-end tests suite
45+
46+
To execute both CLI and standalone e2e tests, run :
47+
48+
```console
49+
make e2e
50+
```
51+
52+
Or if you need to build the CLI, run:
53+
```console
54+
make build-and-e2e
55+
```
56+
57+
#### Plugin end-to-end tests suite
58+
59+
To execute CLI plugin e2e tests, run :
4060

4161
```console
4262
make e2e-compose
4363
```
4464

45-
Note that this requires a local Docker Engine to be running.
65+
Or if you need to build the CLI, run:
66+
```console
67+
make build-and-e2e-compose
68+
```
69+
70+
#### Standalone end-to-end tests suite
71+
72+
To execute the standalone CLI e2e tests, run :
73+
74+
```console
75+
make e2e-compose-standalone
76+
```
77+
78+
Or if you need to build the CLI, run:
79+
```console
80+
make build-and-e2e-compose-standalone
81+
```
4682

4783
## Releases
4884

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ e2e-compose-standalone: ## Run End to end local tests in standalone mode. Set E2
5151
docker-compose version
5252
go test $(TEST_FLAGS) -v -count=1 -parallel=1 --tags=standalone ./pkg/e2e
5353

54+
.PHONY: build-and-e2e-compose
55+
build-and-e2e-compose: compose-plugin e2e-compose ## Compile the compose cli-plugin and run end to end local tests in plugin mode. Set E2E_TEST=TestName to run a single test
56+
57+
.PHONY: build-and-e2e-compose-standalone
58+
build-and-e2e-compose-standalone: compose-plugin e2e-compose-standalone ## Compile the compose cli-plugin and run End to end local tests in standalone mode. Set E2E_TEST=TestName to run a single test
59+
5460
.PHONY: mocks
5561
mocks:
5662
mockgen -destination pkg/mocks/mock_docker_cli.go -package mocks github.com/docker/cli/cli/command Cli
@@ -60,6 +66,9 @@ mocks:
6066
.PHONY: e2e
6167
e2e: e2e-compose e2e-compose-standalone ## Run end to end local tests in both modes. Set E2E_TEST=TestName to run a single test
6268

69+
.PHONY: build-and-e2e
70+
build-and-e2e: compose-plugin e2e-compose e2e-compose-standalone ## Compile the compose cli-plugin and run end to end local tests in both modes. Set E2E_TEST=TestName to run a single test
71+
6372
.PHONY: cross
6473
cross: ## Compile the CLI for linux, darwin and windows
6574
@docker build . --target cross \

0 commit comments

Comments
 (0)