Skip to content

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

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

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.

@@ -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

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.

philrenaud added a commit that referenced this pull request Feb 21, 2025
* retain artifacts from test runs including test timing

* Pinning commit hashes for action helpers

* trigger for ui-test run

* Trying to isolate down to a simple upload

* Once more with mkdir

* What if we just wrote our own test reporter tho

* Let the partitioned runs handle placement

* Filter out common token logs, add a summary at the end, and note failures in logtime

* Custom reporter cannot also have an output file, he finds out two days late

* Aggregate summary, duration, and removing failure case

* Conditional test report generation

* Timeouts are errors

* Trying with un-partitioned input json file

* Remove the commented-out lines for main-only runs

* combine-ui-test-results as its own script
philrenaud added a commit that referenced this pull request Feb 21, 2025
…release/1.9.x (#25177)

* no-op commit due to failed cherry-picking

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

* retain artifacts from test runs including test timing

* Pinning commit hashes for action helpers

* trigger for ui-test run

* Trying to isolate down to a simple upload

* Once more with mkdir

* What if we just wrote our own test reporter tho

* Let the partitioned runs handle placement

* Filter out common token logs, add a summary at the end, and note failures in logtime

* Custom reporter cannot also have an output file, he finds out two days late

* Aggregate summary, duration, and removing failure case

* Conditional test report generation

* Timeouts are errors

* Trying with un-partitioned input json file

* Remove the commented-out lines for main-only runs

* combine-ui-test-results as its own script

* Remove the Ember Test Audit workflow (#24637)

* [ui, tests] Various acceptance test fixups (v main) (#25031)

* Add factory hooks for jobs to have previously stable versions and stopped status

* Since #24973 node-read isn't presupposed and so should regex match only on the common url parts

* Job detail tests for title buttons are now bimodal and default to having previously-stable version in history

* prettier plz

* Breaking a thing on purpose to see if my other broken thing is broken

* continue-on-error set to false to get things red when appropriate

* OK what if continue-on-error=true but we do a separate failure reporting after the fact

* fail-fast are you the magic incantation that I need?

* Re-fix my test now that fast-fail is off

* Fix to server-leader by adding a region first, and always()-append to uploading partition results

* Express failure step lists failing tests so you don't have to click back into ember-exam step

* temporary snapshot and logging for flakey test in service job detail

* Bunch of region and tasklogs test fixups

* using allocStatusDistribution to ensure service job always has a non-queued alloc

* Manually remove ember test audit (re-do #24637)

---------

Co-authored-by: temp <[email protected]>
Co-authored-by: Phil Renaud <[email protected]>
Co-authored-by: Phil Renaud <[email protected]>
Copy link

github-actions bot commented Apr 3, 2025

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants