Skip to content

Commit

Permalink
parallelize loadtests & cross-compiles (#716)
Browse files Browse the repository at this point in the history
* parallelize loadtests.

* print tests to be run by each worker.

* listtests -s

* eliminate excess quote

* build more in parallel.

* parallelize lint, in-container

* fix broken variables.

* use more robust parallelism
  • Loading branch information
lizthegrey authored Mar 27, 2020
1 parent 48812d5 commit 50cbc17
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 31 deletions.
8 changes: 5 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
paths: go/bin
- run:
name: Lint
command: make checklicense impi lint misspell
command: make -j4 checklicense impi lint misspell
- run:
name: Lint testbed
command: make -C testbed fmt vet lint
Expand All @@ -100,22 +100,24 @@ jobs:

cross-compile:
executor: golang
parallelism: 4
steps:
- attach_to_workspace
- run:
name: Build collector for all archs
command: make binaries-all-sys
command: grep ^binaries-all-sys Makefile|fmt -w 1|tail -n +2|circleci tests split|xargs make
- persist_to_workspace:
root: ~/
paths: project/bin

loadtest:
executor: golang
parallelism: 10
steps:
- attach_to_workspace
- run:
name: Loadtest
command: make -C testbed runtests
command: TEST_ARGS="-test.run=$(make -s -C testbed listtests | circleci tests split|xargs echo|sed 's/ /|/g')" make -C testbed runtests
- store_artifacts:
path: testbed/tests/results
- store_test_results:
Expand Down
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,20 @@ docker-otelcol:
binaries: otelcol

.PHONY: binaries-all-sys
binaries-all-sys:
binaries-all-sys: binaries-darwin_amd64 binaries-linux_amd64 binaries-linux_arm64 binaries-windows_amd64

.PHONY: binaries-darwin_amd64
binaries-darwin_amd64:
GOOS=darwin GOARCH=amd64 $(MAKE) binaries

.PHONY: binaries-linux_amd64
binaries-linux_amd64:
GOOS=linux GOARCH=amd64 $(MAKE) binaries

.PHONY: binaries-linux_arm64
binaries-linux_arm64:
GOOS=linux GOARCH=arm64 $(MAKE) binaries

.PHONY: binaries-windows_amd64
binaries-windows_amd64:
GOOS=windows GOARCH=amd64 $(MAKE) binaries
4 changes: 4 additions & 0 deletions testbed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ test:
runtests: test
./runtests.sh

.PHONY: listtests
listtests:
TESTBED_CONFIG=local.yaml $(GOTEST) -v ./tests --test.list '.*'|head -n -1

.PHONY: fmt
fmt:
$(GOFMT) -s -l ./..
Expand Down
1 change: 0 additions & 1 deletion testbed/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/golang/protobuf v1.3.2
github.com/open-telemetry/opentelemetry-collector v0.2.4-0.20200115225140-264426a9cae4
github.com/shirou/gopsutil v2.18.12+incompatible
github.com/spf13/viper v1.4.1-0.20190911140308-99520c81d86e
github.com/stretchr/testify v1.4.0
go.uber.org/zap v1.10.0
)
Expand Down
Loading

0 comments on commit 50cbc17

Please sign in to comment.