Skip to content

Commit bd72c31

Browse files
committed
Improve CONTRIBUTING.md
1 parent d8abc3a commit bd72c31

File tree

5 files changed

+17
-72
lines changed

5 files changed

+17
-72
lines changed

.circleci/config.yml

-25
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,6 @@ jobs:
5656
- store_test_results:
5757
path: ci/out
5858

59-
bench:
60-
docker:
61-
- image: nhooyr/websocket-ci
62-
steps:
63-
- checkout
64-
- restore_cache:
65-
keys:
66-
- go-v3-{{ checksum "go.sum" }}
67-
# Fallback to using the latest cache if no exact match is found.
68-
- go-v3-
69-
- run: ./ci/bench.sh
70-
- store_artifacts:
71-
path: ci/out
72-
destination: out
73-
- save_cache:
74-
paths:
75-
- /root/gopath
76-
- /root/.cache/go-build
77-
key: go-v3-{{ checksum "go.sum" }}
78-
- store_test_results:
79-
path: ci/out
80-
8159
workflows:
8260
version: 2
8361
fmt:
@@ -89,6 +67,3 @@ workflows:
8967
test:
9068
jobs:
9169
- test
92-
bench:
93-
jobs:
94-
- bench

ci/bench.sh

-30
This file was deleted.

ci/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ cd "$(git rev-parse --show-toplevel)"
88

99
./ci/fmt.sh
1010
./ci/lint.sh
11-
./ci/test.sh
11+
./ci/test.sh

ci/test.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ set -euo pipefail
44
cd "$(dirname "${0}")"
55
cd "$(git rev-parse --show-toplevel)"
66

7-
mkdir -p ci/out/gotest
8-
testFlags=(-race "-vet=off" "-coverprofile=ci/out/coverage.prof" "-coverpkg=./...")
7+
mkdir -p ci/out/websocket
8+
testFlags=(-race "-vet=off" "-bench=." "-coverprofile=ci/out/coverage.prof" "-coverpkg=./...")
99
if [[ ${CI-} ]]; then
1010
# https://circleci.com/docs/2.0/collect-test-data/
1111
go test "${testFlags[@]}" -v ./... 2>&1 | tee /dev/stderr |
12-
go run github.com/jstemmer/go-junit-report > ci/out/gotest/report.xml
12+
go run github.com/jstemmer/go-junit-report > ci/out/websocket/testReport.xml
1313
else
1414
go test "${testFlags[@]}" ./...
1515
fi

docs/CONTRIBUTING.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ You can run tests normally with `go test`.
2222
You'll need the [Autobahn Test suite pip package](https://github.com/crossbario/autobahn-testsuite).
2323
In the future this dependency will be removed. See [#117](https://github.com/nhooyr/websocket/issues/117).
2424

25-
On submission please check if CI has passed and if not, please correct your code such that it does.
26-
If necessary, you may run CI locally with the `ci/run.sh` script which will fmt, lint and test your code
27-
with coverage.
28-
You'll need [shellcheck](https://github.com/koalaman/shellcheck#installing), node and the
29-
Autobahn Test suite linked above.
25+
Please ensure CI passes for your changes. If necessary, you may run CI locally. The various steps are located
26+
in `ci/*.sh`.
3027

31-
For coverage details locally, please see `ci/out/coverage.html` after running `ci/run.sh` or `ci/test.sh`.
32-
For remote coverage, you can use either [codecov](https://codecov.io/gh/nhooyr/websocket) or download the
33-
`coverage.html` artifact on the test step in CI.
28+
`ci/fmt.sh` requires node (specifically prettier).
29+
`ci/lint.sh` requires [shellcheck](https://github.com/koalaman/shellcheck#installing).
30+
`ci/test.sh` requires the [Autobahn Test suite pip package](https://github.com/crossbario/autobahn-testsuite).
31+
`ci/bench.sh` requires only Go.
32+
`ci/run.sh` runs everything in the above order and requires all of their dependencies.
3433

35-
You can also run any of the CI steps individually. All of them are scripts in the `ci` directory.
34+
See [../ci/image/Dockerfile](../ci/image/Dockerfile) for the installation of the CI dependencies on ubuntu.
3635

37-
See [../ci/image/Dockerfile](../ci/image/Dockerfile) for the
38-
installation of the CI dependencies on arch linux.
36+
For CI coverage, you can use either [codecov](https://codecov.io/gh/nhooyr/websocket) or click the
37+
`coverage.html` artifact on the test step in CI.
38+
For coverage details locally, please see `ci/out/coverage.html` after running `ci/run.sh` or `ci/test.sh`.
3939

40-
You can benchmark the library with `./ci/benchmark.sh`. You only need Go to run that script.
41-
Benchmark profiles generated by that script are also available as artifacts on the bench step.
40+
Benchmark profiles generated by `bench.sh` are available as artifacts on the bench step so that they
41+
may be analyzed.

0 commit comments

Comments
 (0)