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

test(publish-metrics): add tests for otel tracing #2718

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

InesNi
Copy link
Contributor

@InesNi InesNi commented May 9, 2024

Description

Implementing tests for publish-metrics tracing.

  • A custom FileSpanExporter is created for testing purposes and is enabled through the exporter and __outputPath setting in the OTel reporter configuration:
  plugins:
    publish-metrics:
      - type: "open-telemetry"
        traces:
          exporter: "__test"
          __outputPath: "json-file-to-export-spans-to"

Both the ConsoleSpanExporter and InMemorySpanExporter were considered for testing purposes but creating a custom file exporter ended up being the most straightforward option with the least possible change to the logic of the OTel reporter.

An extensive test for the HTTP engine tracing basic functionality support has been added including a test for the parallel scenario configuration and test runs with errors.

Pre-merge checklist

  • Does this require an update to the docs?
  • Does this require a changelog entry?

@InesNi InesNi changed the title Ifazlic art 1735 write tests for parallel test(publish-metrics): add test for otel tracing May 9, 2024
@InesNi InesNi changed the title test(publish-metrics): add test for otel tracing test(publish-metrics): add tests for otel tracing May 9, 2024
@InesNi InesNi force-pushed the ifazlic-art-1735-write-tests-for-parallel branch from 0faa470 to 816cdeb Compare May 9, 2024 17:03
@InesNi InesNi force-pushed the ifazlic-art-1735-write-tests-for-parallel branch 2 times, most recently from 084d519 to 1961a50 Compare May 12, 2024 20:11
@InesNi InesNi marked this pull request as ready for review May 13, 2024 08:43
@InesNi InesNi force-pushed the ifazlic-art-1735-write-tests-for-parallel branch from 95ea16e to 7c48e3d Compare May 13, 2024 08:49
@@ -44,7 +44,7 @@
},
"scripts": {
"test:unit": "tap --no-coverage --timeout=420 --color test/unit/*.test.js",
"test:acceptance": "export ARTILLERY_TELEMETRY_DEFAULTS='{\"source\":\"test-suite\"}' && tap --no-coverage --timeout=420 test/cli/*.test.js && bash test/lib/run.sh && tap --no-coverage --color test/testcases/plugins/*.test.js",
"test:acceptance": "export ARTILLERY_TELEMETRY_DEFAULTS='{\"source\":\"test-suite\"}' && tap --no-coverage --timeout=420 test/cli/*.test.js && bash test/lib/run.sh && tap --no-coverage --color test/testcases/plugins/*.test.js && tap --no-coverage --color --timeout=3000 test/publish-metrics/*/*.test.js",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

None yet

2 participants