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

feat(trace): experimental traces for our tests #3567

Merged
merged 2 commits into from
Aug 28, 2020
Merged

feat(trace): experimental traces for our tests #3567

merged 2 commits into from
Aug 28, 2020

Conversation

dgozman
Copy link
Contributor

@dgozman dgozman commented Aug 21, 2020

This introduces basic tracing enabled in our tests.

What is captured:

  • network resources;
  • snapshots at the start of most actions;
  • snapshot after the test failure.

How this integrates with test runner:

  • context fixture calls private method context._initSnapshotter() and uses Tracer to trace all events;
  • all tests share a single test-results/trace-storage directory to store blobs;
  • each test has its own trace file.

npm run show-trace opens a bare-minimum trace viewer that renders snapshots.

@dgozman dgozman changed the title [WIP] feat(trace): experimental traces for our tests feat(trace): experimental traces for our tests Aug 24, 2020
@dgozman dgozman marked this pull request as ready for review August 24, 2020 22:45
test/showTrace.js Outdated Show resolved Hide resolved
test/playwright.fixtures.ts Outdated Show resolved Hide resolved
test-runner/src/builtin.fixtures.ts Outdated Show resolved Hide resolved
src/utils/traceTypes.ts Outdated Show resolved Hide resolved
src/utils/traceTypes.ts Outdated Show resolved Hide resolved
src/server/trace/traceController.ts Outdated Show resolved Hide resolved
src/server/trace/snapshotter.ts Outdated Show resolved Hide resolved
src/server/trace/snapshotter.ts Outdated Show resolved Hide resolved
src/server/browserContext.ts Outdated Show resolved Hide resolved
src/client/traceViewer.ts Outdated Show resolved Hide resolved
This introduces basic tracing enabled in our tests:

- capturing network resources;
- capturing snapshots at the start of most actions;
- manually capturing snapshots by test runner when the test fails.
@dgozman dgozman merged commit b34d9ab into microsoft:master Aug 28, 2020
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.

2 participants