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

[ui, ci] retain artifacts from test runs including test timing #24555

Merged
merged 15 commits into from
Dec 3, 2024

Conversation

philrenaud
Copy link
Contributor

@philrenaud philrenaud commented Nov 26, 2024

Description

Our ember-test-audit action is currently failing, and I'm using that as an excuse to improve our front-end testing story generally.

This will be a two-step approach, and this PR is the first step:

  1. Save artifacts, including test timing, from test-ui test results on merge to main
  2. Compare to a rolling window of these test results on subsequent PRs

This PR adds artifact uploads on the back of test-ui. Because those are partitioned/run concurrently 4x, part of this is combining those.

The artifact generated looks like this:

{
  "timestamp": "2024-12-02T18:20:59.531Z",
  "sha": "7fd10531ef3e12672a19a7a9aa7a6e4f4f874614",
  "summary": {
    "total": 1606,
    "passed": 1606,
    "failed": 0
  },
  "duration": 841403,
  "tests": [
    {
      "name": "Acceptance | allocation fs: it passes an accessibility audit",
      "partition": 1,
      "browser": "Chrome 131.0",
      "passed": true,
      "duration": 1331,
      "error": null,
      "logs": []
    },
    {
      "name": "Acceptance | allocation fs: visiting filesystem root",
      "partition": 1,
      "browser": "Chrome 131.0",
      "passed": true,
      "duration": 505,
      "error": null,
      "logs": []
    },
    {
      "name": "Acceptance | allocation fs: visiting filesystem paths",
      "partition": 1,
      "browser": "Chrome 131.0",
      "passed": true,
      "duration": 542,
      "error": null,
      "logs": []
    },
...

In phase 2 of this, we'll be able to do test-by-test duration averages and comparisons, and tease out those tests with the greatest deltas, find flakes, etc.

.github/workflows/test-ui.yml Fixed Show fixed Hide fixed
.github/workflows/test-ui.yml Fixed Show fixed Hide fixed
.github/workflows/test-ui.yml Fixed Show fixed Hide fixed
@@ -24,6 +24,7 @@
{{content-for "body"}}

<script src="{{rootURL}}assets/vendor.js"></script>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no-op to trigger the

  pull_request:
    paths:
      - "ui/**"

part of the action.

Copy link

github-actions bot commented Nov 26, 2024

Ember Test Audit comparison

main 41c9725 change
passes 1580 1580 0
failures 5 5 0
flaky 0 0 0
duration 000ms 000ms -000ms

tgross
tgross previously approved these changes Dec 2, 2024
Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM

.github/workflows/test-ui.yml Outdated Show resolved Hide resolved
Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM!

@philrenaud philrenaud merged commit 4b91c17 into main Dec 3, 2024
34 of 37 checks passed
@philrenaud philrenaud deleted the b-ui/ember-audit-test-artifacts branch December 3, 2024 14:56
Copy link
Contributor

@DingoEatingFuzz DingoEatingFuzz left a comment

Choose a reason for hiding this comment

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

Super cool to see this work get picked up again 🤩

Comment on lines +17 to +21
for (let i = 1; i <= NUM_PARTITIONS; i++) {
try {
const data = JSON.parse(
fs.readFileSync(`../test-results/test-results-${i}/test-results.json`).toString()
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Will there be anything else in the test-results directory other than subdirectories for each partition?

I wonder if you can walk the dir tree instead of relying on synchronizing NUM_PARTITIONS and the GHA matrix config.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I left a pretty verbose dir trail here with the hope that I'd populate this with further artifacts / test-run metadata. No explicit plans yet, though!

tests: results
};

fs.writeFileSync('../ui/combined-test-results.json', JSON.stringify(output, null, 2));
Copy link
Contributor

Choose a reason for hiding this comment

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

Doing a combine step that takes json and emits json is really nice. Should prove to be more flexible than trying to do all the collating, aggregating, and analysis in one script.

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.

3 participants