File tree 4 files changed +99
-1
lines changed
4 files changed +99
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : End-to-end test
2
+
3
+ on :
4
+ pull_request :
5
+ workflow_dispatch :
6
+ inputs :
7
+ test-perf :
8
+ type : boolean
9
+ description : ' Whether to run the (slow) end-to-end perf tests'
10
+ default : false
11
+
12
+ jobs :
13
+ e2e-test :
14
+ runs-on : ubuntu-latest
15
+
16
+ steps :
17
+ - name : Setup Go
18
+ uses : actions/setup-go@v3
19
+ with :
20
+ go-version : ' stable'
21
+
22
+ - name : Setup Node.js
23
+ uses : actions/setup-node@v3
24
+ with :
25
+ node-version : 18
26
+
27
+ - name : Clone repository
28
+ uses : actions/checkout@v3
29
+
30
+ - name : Install system dependencies for end-to-end tests
31
+ run : build/ci/install-dependencies.sh
32
+ shell : bash
33
+
34
+ - name : Enable perf tests
35
+ if : ${{ github.event.inputs.test-perf }}
36
+ run : echo "TEST_E2E_PERF=1" >> $GITHUB_ENV
37
+
38
+ - name : Run end-to-end tests
39
+ env :
40
+ TEST_E2E_PERF : ${{matrix.jobs.goarch}}
41
+ run : make e2e-test TEST_E2E_PERF="$TEST_E2E_PERF"
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ INSTALL_ROOT := /
13
13
BINDIR := $(CURDIR ) /bin
14
14
DISTDIR := $(CURDIR ) /_dist
15
15
DOCDIR := $(CURDIR ) /_docs
16
+ TESTDIR := $(CURDIR ) /_test
16
17
17
18
# Platform information
18
19
GOOS := $(shell go env GOOS)
@@ -22,6 +23,9 @@ GOARCH := $(shell go env GOARCH)
22
23
SUPPORTED_PACKAGE_GOARCHES := amd64 arm64
23
24
PACKAGE_ARCH := $(GOARCH )
24
25
26
+ # Guard against environment variables
27
+ TEST_E2E_PERF =
28
+
25
29
# Build targets
26
30
.PHONY : build
27
31
build :
38
42
.PHONY : e2e-test
39
43
e2e-test : build
40
44
@echo
41
- @scripts/ci/install-dependencies.sh
45
+ @echo " ======== Running end-to-end tests ========"
46
+ $(RM ) -r $(TESTDIR )
47
+ @if [ -n " $( TEST_E2E_PERF) " ]; then \
48
+ ./scripts/run-e2e-tests.sh --all; \
49
+ else \
50
+ ./scripts/run-e2e-tests.sh; \
51
+ fi
42
52
43
53
# Installation targets
44
54
.PHONY : install
@@ -141,3 +151,4 @@ clean:
141
151
$(RM ) -r $(BINDIR )
142
152
$(RM ) -r $(DISTDIR )
143
153
$(RM ) -r $(DOCDIR )
154
+ $(RM ) -r $(TESTDIR )
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ die () {
3
+ echo " $* " >&2
4
+ exit 1
5
+ }
6
+
7
+ # Exit as soon as any line fails
8
+ set -e
9
+
10
+ # Install latest version of Git (minimum v2.40)
11
+ if command -v apt-get; then
12
+ sudo apt-get -q -y install git
13
+ elif command -v brew; then
14
+ else
15
+ brew install git
16
+ die ' Cannot install git'
17
+ fi
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ THISDIR=" $( cd " $( dirname " $0 " ) " ; pwd -P ) "
4
+ TESTDIR=" $THISDIR /../test/e2e"
5
+
6
+ # Defaults
7
+ NPM_TARGET=" test"
8
+
9
+ # Parse script arguments
10
+ for i in " $@ "
11
+ do
12
+ case " $i " in
13
+ --all)
14
+ NPM_TARGET=" test-all"
15
+ shift # past argument
16
+ ;;
17
+ * )
18
+ die " unknown option '$i '"
19
+ ;;
20
+ esac
21
+ done
22
+
23
+ # Exit as soon as any line fails
24
+ set -e
25
+
26
+ cd " $TESTDIR "
27
+
28
+ npm install
29
+ npm run $NPM_TARGET
You can’t perform that action at this time.
0 commit comments