forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem ======= We need a way to run E2E tests with real agent and a load generator. Particularly important class of E2E tests are performance tests in controlled environment. Solution ======== The test bed allows to easily set up a test that requires running the agent and a load generator, measure and define resource consumption expectations for the agent, fail tests automatically when expectations are exceeded. Each test case requires a agent configuration file and (optionally) load generator spec file. Test cases are defined as regular Go tests, see examples in perf_test.go. To run E2E tests go to testbed directory and run "make runtests" or run "make perf-tests" from top-level directory. Note that E2E tests are skipped when running regular "make test" target. The reason is that because E2E tests take a lot of time and require non-concurrent execution while other tests are typical run with -race flag. See also design doc here: https://docs.google.com/document/d/1omU06mBYGY0slT1yojttn9BCyp18pHaRjkkYZrY8H4Q/edit# TODO ===== We plan to add the following functionality later: - Ability for load generator to record what it generated and then use that information to validate data received by mock backend from the agent. - Enforce resource consumption limits on the agent to allow testing scenarios under specific available resource situations (as opposed to measuring and failing tests which is already implemented and which is useful in different scenarios).
- Loading branch information
1 parent
d05ec08
commit b4c9671
Showing
19 changed files
with
1,951 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
GOTEST_OPT?=-v -race -timeout 30s | ||
GOTEST_OPT_WITH_COVERAGE = $(GOTEST_OPT) -coverprofile=coverage.txt -covermode=atomic | ||
GOTEST=go test | ||
GOFMT=gofmt | ||
GOLINT=golint | ||
GOVET=go vet | ||
GOOS=$(shell go env GOOS) | ||
|
||
.DEFAULT_GOAL := fmt-vet-lint-test | ||
|
||
.PHONY: fmt-vet-lint-test | ||
fmt-vet-lint-test: fmt vet lint test | ||
|
||
.PHONY: test | ||
test: | ||
$(GOTEST) $(GOTEST_OPT) ./... | ||
|
||
.PHONY: runtests | ||
runtests: test | ||
cd tests && TESTBED_CONFIG=local.yaml go test -v 2>&1 | tee results/testoutput.log | ||
cd tests && mkdir -p results/junit && go-junit-report < results/testoutput.log > results/junit/results.xml | ||
|
||
.PHONY: fmt | ||
fmt: | ||
@FMTOUT=`$(GOFMT) -s -l ./.. 2>&1`; \ | ||
if [ "$$FMTOUT" ]; then \ | ||
echo "$(GOFMT) FAILED => gofmt the following files:\n"; \ | ||
echo "$$FMTOUT\n"; \ | ||
exit 1; \ | ||
else \ | ||
echo "Fmt finished successfully"; \ | ||
fi | ||
|
||
.PHONY: lint | ||
lint: | ||
@LINTOUT=`$(GOLINT) $(ALL_PKGS) 2>&1`; \ | ||
if [ "$$LINTOUT" ]; then \ | ||
echo "$(GOLINT) FAILED => clean the following lint errors:\n"; \ | ||
echo "$$LINTOUT\n"; \ | ||
exit 1; \ | ||
else \ | ||
echo "Lint finished successfully"; \ | ||
fi | ||
|
||
.PHONY: vet | ||
vet: | ||
$(GOVET) ./... | ||
|
||
.PHONY: install-tools | ||
install-tools: | ||
go install golang.org/x/lint/golint | ||
go install github.com/jstemmer/go-junit-report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# OpenTelemetry Service Testbed | ||
|
||
Testbed is a controlled environment and tools for conducting performance tests for the Agent, including reproducible short-term benchmarks,long-running stability tests and maximum load stress tests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module github.com/open-telemetry/opentelemetry-service/testbed | ||
|
||
go 1.12 | ||
|
||
require ( | ||
contrib.go.opencensus.io/exporter/jaeger v0.1.1-0.20190430175949-e8b55949d948 | ||
github.com/open-telemetry/opentelemetry-service v0.0.0-20190625135304-4bd705a25a35 | ||
github.com/shirou/gopsutil v2.18.12+incompatible | ||
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect | ||
github.com/spf13/viper v1.4.0 | ||
github.com/stretchr/testify v1.3.0 | ||
go.opencensus.io v0.22.0 | ||
) |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.