Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemtest: add tests for aggregation and sampling #4084

Merged
merged 6 commits into from
Sep 3, 2020

Conversation

axw
Copy link
Member

@axw axw commented Aug 19, 2020

Motivation/summary

Migrate aggregation and sampling system tests to Go.

As part of this we introduce "approval" test support.
The implementation is a little different to the Python
version: the Python version ignores various dynamic
fields when computing the diff, whereas in this version
we replace dynamic fields before comparing, so the
approved files don't change in unrelated ways every
time there is an expected change, such as a new field.

Checklist

I have considered changes for:
- [ ] documentation
- [ ] logging (add log lines, choose appropriate log selector, etc.)
- [ ] metrics and monitoring (create issue for Kibana team to add metrics to visualizations, e.g. Kibana#44001)

How to test these changes

cd systemtest && go test -v

Related issues

None.

@apmmachine
Copy link
Contributor

apmmachine commented Aug 19, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Branch indexing]

  • Start Time: 2020-09-03T02:50:13.166+0000

  • Duration: 48 min 51 sec

Test stats 🧪

Test Results
Failed 0
Passed 3225
Skipped 139
Total 3364

Steps errors

Expand to view the steps failures

  • Name: Compress

    • Description: tar --exclude=coverage-files.tgz -czf coverage-files.tgz coverage

    • Duration: 0 min 0 sec

    • Start Time: 2020-09-03T03:04:56.161+0000

    • log

  • Name: Compress

    • Description: tar --exclude=system-tests-linux-files.tgz -czf system-tests-linux-files.tgz system-tests

    • Duration: 0 min 0 sec

    • Start Time: 2020-09-03T03:19:22.130+0000

    • log

  • Name: Test Sync

    • Description: ./script/jenkins/sync.sh

    • Duration: 3 min 55 sec

    • Start Time: 2020-09-03T02:59:59.537+0000

    • log

@axw axw marked this pull request as ready for review August 20, 2020 05:08
@axw axw requested a review from a team August 20, 2020 05:08
systemtest/aggregation_test.go Show resolved Hide resolved
systemtest/apmservertest/filter.go Show resolved Hide resolved
systemtest/approvals.go Outdated Show resolved Hide resolved
@axw
Copy link
Member Author

axw commented Aug 26, 2020

It's going to take a bit to shuffle the approvals code around, so I'll move the PR back into draft for now.

@axw axw marked this pull request as draft August 26, 2020 02:41
@axw axw mentioned this pull request Aug 29, 2020
2 tasks
Migrate aggregation and sampling system tests to Go.

As part of this we introduce "approval" test support.
The implementation is a little different to the one
in the Python system tests: the Python ones ignore
various dynamic fields when computing the diff; we
replace dynamic fields before comparing, so the
approved diffs don't change in unrelated ways every
time there is an expected change, such as a new field.
If we don't consume the response, the server
may (non-determinstically) log an error.
@axw axw marked this pull request as ready for review August 31, 2020 10:00
@axw axw requested a review from simitt August 31, 2020 10:00
@codecov-commenter
Copy link

Codecov Report

Merging #4084 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #4084   +/-   ##
=======================================
  Coverage   80.34%   80.34%           
=======================================
  Files         142      142           
  Lines        6712     6712           
=======================================
  Hits         5393     5393           
  Misses       1319     1319           

@axw axw merged commit d714f73 into elastic:master Sep 3, 2020
@axw axw deleted the aggregation-system-tests branch September 3, 2020 06:40
axw added a commit to axw/apm-server that referenced this pull request Sep 8, 2020
* systemtest: add tests for aggregation and sampling

Migrate aggregation and sampling system tests to Go.

As part of this we introduce "approval" test support.
The implementation is a little different to the one
in the Python system tests: the Python ones ignore
various dynamic fields when computing the diff; we
replace dynamic fields before comparing, so the
approved diffs don't change in unrelated ways every
time there is an expected change, such as a new field.

* systemtest: update aggregation config

* Check result in TestTransactionAggregationShutdown

* systemtest: fix logging test

If we don't consume the response, the server
may (non-determinstically) log an error.

* Update approved files
axw added a commit that referenced this pull request Sep 8, 2020
* systemtest: add tests for aggregation and sampling

Migrate aggregation and sampling system tests to Go.

As part of this we introduce "approval" test support.
The implementation is a little different to the one
in the Python system tests: the Python ones ignore
various dynamic fields when computing the diff; we
replace dynamic fields before comparing, so the
approved diffs don't change in unrelated ways every
time there is an expected change, such as a new field.

* systemtest: update aggregation config

* Check result in TestTransactionAggregationShutdown

* systemtest: fix logging test

If we don't consume the response, the server
may (non-determinstically) log an error.

* Update approved files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants