This repository was archived by the owner on Sep 3, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ INSTALL_ROOT := /
1313BINDIR := $(CURDIR ) /bin
1414DISTDIR := $(CURDIR ) /_dist
1515DOCDIR := $(CURDIR ) /_docs
16+ TESTDIR := $(CURDIR ) /_test
1617
1718# Platform information
1819GOOS := $(shell go env GOOS)
@@ -26,6 +27,7 @@ PACKAGE_ARCH := $(GOARCH)
2627APPLE_APP_IDENTITY =
2728APPLE_INST_IDENTITY =
2829APPLE_KEYCHAIN_PROFILE =
30+ E2E_FLAGS =
2931
3032# Build targets
3133.PHONY : build
3941 @scripts/make-docs.sh --docs=" $( CURDIR) /docs/man" \
4042 --output=" $( DOCDIR) "
4143
44+ # Testing targets
45+ .PHONY : e2e-test
46+ e2e-test : build
47+ @echo
48+ @echo " ======== Running end-to-end tests ========"
49+ $(RM ) -r $(TESTDIR )
50+ @scripts/run-e2e-tests.sh $(E2E_FLAGS )
51+
4252# Installation targets
4353.PHONY : install
4454install : build doc
@@ -170,3 +180,4 @@ clean:
170180 $(RM ) -r $(BINDIR )
171181 $(RM ) -r $(DISTDIR )
172182 $(RM ) -r $(DOCDIR )
183+ $(RM ) -r $(TESTDIR )
Original file line number Diff line number Diff line change @@ -170,11 +170,45 @@ $ go build -o bin/ ./...
170170
171171### Testing and Linting
172172
173- To run the project's unit tests, navigate to the repository root directory and
174- run ` go test -v ./... ` .
173+ Unless otherwise specified, run commands from the repository root.
175174
176- To run the project's linter, navigate to the repository root directory and run
177- ` go vet ./... ` .
175+ #### Unit tests
176+
177+ ```
178+ go test -v ./...
179+ ```
180+
181+ #### Linter
182+
183+ ```
184+ go vet ./...
185+ ```
186+
187+ #### End-to-end tests
188+
189+ In order to run these tests, you need to have a recent version of
190+ [ Node.js] ( https://nodejs.org ) (current LTS version is a pretty safe bet) and NPM
191+ installed.
192+
193+ For the standard set of tests (i.e., excluding exceptionally slow tests), run:
194+
195+ ```
196+ make e2e-test
197+ ```
198+
199+ To configure the test execution and filtering, set the ` E2E_FLAGS ` build
200+ variable. The available options are:
201+
202+ * ` --offline ` : run all tests except those that require internet access.
203+ * ` --all ` : run all tests, including slow performance tests.
204+
205+ The above modes are mutually exclusive; if multiple are specified, only the last
206+ will be used. For example, ` E2E_FLAGS="--offline --all" ` is equivalent to
207+ ` E2E_FLAGS="--all" ` .
208+
209+ :warning : The performance tests that are excluded by default clone very large
210+ repos from the internet and can take anywhere from ~ 30 minutes to multiple hours
211+ to run, depending on internet connectivity and other system resources.
178212
179213## License
180214
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+ ARGS=()
8+
9+ # Parse script arguments
10+ for i in " $@ "
11+ do
12+ case " $i " in
13+ --offline)
14+ ARGS+=(" -p" " offline" )
15+ shift # past argument
16+ ;;
17+ --all)
18+ ARGS+=(" -p" " all" )
19+ shift # past argument
20+ ;;
21+ * )
22+ die " unknown option '$i '"
23+ ;;
24+ esac
25+ done
26+
27+ # Exit as soon as any line fails
28+ set -e
29+
30+ cd " $TESTDIR "
31+
32+ npm install
33+ npm run test -- ${ARGS: +${ARGS[*]} }
You can’t perform that action at this time.
0 commit comments