File tree 5 files changed +60
-14
lines changed
5 files changed +60
-14
lines changed Original file line number Diff line number Diff line change 1
1
cf-custom-resources /node_modules
2
- bin
3
- .idea
2
+ .idea
Original file line number Diff line number Diff line change @@ -8,4 +8,4 @@ RUN apt-get update && apt-get install -y nodejs
8
8
WORKDIR /aws-amazon-ecs-cli-v2
9
9
COPY . .
10
10
RUN go env -w GOPROXY=direct
11
- RUN make release
11
+ RUN make release
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ all: build
23
23
.PHONY : build
24
24
build : packr-build compile-local packr-clean
25
25
26
+ .PHONY : build-e2e
27
+ build-e2e : packr-build compile-linux packr-clean
28
+
26
29
.PHONY : release
27
30
release : packr-build compile-darwin compile-linux compile-windows packr-clean
28
31
@@ -99,17 +102,12 @@ run-integ-test:
99
102
# and runs tests which end in Integration.
100
103
go test -v -count=1 -timeout 60m -tags=integration ${PACKAGES}
101
104
102
- .PHONY : e2e-test
103
- e2e-test : build
104
- # the target assumes the AWS-* environment variables are exported
105
- # -p: The number of test binaries that can be run in parallel
106
- # -parallel: Within a single test binary, how many test functions can run in parallel
107
- env -i PATH=" $$ PATH" GOCACHE=$$(go env GOCACHE ) GOPATH=$$(go env GOPATH ) GOPROXY=direct \
108
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \
109
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
110
- AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN} \
111
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION} \
112
- go test -v -p 1 -parallel 1 -tags=e2e ./e2e...
105
+ .PHONY : e2e
106
+ e2e : build-e2e
107
+ @echo " Building E2E Docker Image" && \
108
+ docker build -t ecs-cli-v2/e2e . -f e2e/Dockerfile
109
+ @echo " Running E2E Tests" && \
110
+ docker run --privileged -it -v ${HOME} /.aws:/home/.aws -e " HOME=/home" ecs-cli-v2/e2e:latest
113
111
114
112
.PHONY : e2e-test-update-golden-files
115
113
e2e-test-update-golden-files :
Original file line number Diff line number Diff line change
1
+ FROM golang:1.13
2
+
3
+ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go get -u github.com/onsi/ginkgo/ginkgo && go get -u github.com/onsi/gomega/...
4
+
5
+ FROM docker:stable-dind
6
+ # Docker needs somewhere to put creds from docker login.
7
+ RUN wget https://github.com/docker/docker-credential-helpers/releases/download/v0.6.0/docker-credential-pass-v0.6.0-amd64.tar.gz && tar -xf docker-credential-pass-v0.6.0-amd64.tar.gz && chmod +x docker-credential-pass && mv docker-credential-pass /bin
8
+ ENV DOCKER_HOST=tcp://127.0.0.1:2375
9
+ ENV GOPROXY direct
10
+
11
+ # Install Go, Git and other dependencies so we can run ginkgo
12
+ RUN apk add --no-cache --virtual .build-deps bash gcc musl-dev openssl go git
13
+
14
+ # Copy the binary
15
+ ADD bin/local/ecs-preview-amd64 /bin/ecs-preview
16
+
17
+ # Add the e2e directory and the project go.mod
18
+ ADD e2e/ github.com/aws/amazon-ecs-cli-v2/e2e/
19
+ ADD go.mod github.com/aws/amazon-ecs-cli-v2/
20
+ ADD go.sum github.com/aws/amazon-ecs-cli-v2/
21
+
22
+ # Startup script which inits dockerd and then runs the e2e tests
23
+ COPY e2e/e2e.sh /bin/
24
+
25
+ ENTRYPOINT ["/bin/e2e.sh" ]
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ set -e
3
+ # Start dockerd
4
+ /usr/local/bin/dockerd \
5
+ --host=unix:///var/run/docker.sock \
6
+ --host=tcp://127.0.0.1:2375 \
7
+ --storage-driver=overlay2 & > /var/log/docker.log &
8
+
9
+ # Wait until dockerd is spun up
10
+ tries=0
11
+ d_timeout=60
12
+ until docker info > /dev/null 2>&1
13
+ do
14
+ if [ " $tries " -gt " $d_timeout " ]; then
15
+ cat /var/log/docker.log
16
+ echo ' Timed out trying to connect to internal docker host.' >&2
17
+ exit 1
18
+ fi
19
+ tries=$(( $tries + 1 ))
20
+ sleep 1
21
+ done
22
+
23
+ # Run all the e2e tests
24
+ cd /github.com/aws/amazon-ecs-cli-v2/e2e/ && ginkgo -v -r
You can’t perform that action at this time.
0 commit comments