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

[e2e] a11y reports are no longer being written to disk #7317

Closed
unlikelyzero opened this issue Dec 20, 2023 · 0 comments · Fixed by #7747
Closed

[e2e] a11y reports are no longer being written to disk #7317

unlikelyzero opened this issue Dec 20, 2023 · 0 comments · Fixed by #7747
Labels
type:maintenance tests, chores, or project maintenance
Milestone

Comments

@unlikelyzero
Copy link
Collaborator

Summary

After merging #7047 , I received a PR comment from @scottbell to

i think we should be using fs/promises here instead. Also, we shouldn't check for the file's existence before creating the directory as we could get into a race condition. something like this instead:

const fs = require('fs').promises;

async function writeAccessibilityReport(reportPath, accessibilityScanResults) {
    try {
        try {
            await fs.mkdir(TEST_RESULTS_DIR, { recursive: true });
        } catch (error) {
            if (error.code !== 'EEXIST') {
                throw error; // Throw the error if it is not because the directory already exists
            }
        }
        
        const data = JSON.stringify(accessibilityScanResults, null, 2);
        await fs.writeFile(reportPath, data); 
        console.log(`Accessibility report with violations saved successfully as ${reportPath}`);
        return accessibilityScanResults;
    } catch (err) {
        console.error(`Error writing the accessibility report to file ${reportPath}:`, err);
        throw err;
    }
}

This ticket tracks that work

@unlikelyzero unlikelyzero added the type:maintenance tests, chores, or project maintenance label Dec 20, 2023
@unlikelyzero unlikelyzero added this to the Target:3.3.0 milestone Dec 20, 2023
@unlikelyzero unlikelyzero removed this from the Target:3.3.0 milestone Jan 17, 2024
@unlikelyzero unlikelyzero added this to the Target:4.0.0 milestone Jun 18, 2024
@unlikelyzero unlikelyzero linked a pull request Jun 18, 2024 that will close this issue
14 tasks
ozyx added a commit that referenced this issue Jun 18, 2024
ozyx added a commit that referenced this issue Jun 19, 2024
* re-enable main test

* Enable tests and fix some failing ones

* revert accidental changes

* test(a11y): on failure, take a screenshot to disk

* test(visual): wait for the snapshot indicator to stop flashing

* Fix all failing tests

* test: disable a11y checks for planning suite

* lint:fix

* fix pathing issues

* build: increase visual-a11y parallelism from 2 to 4

* test: darkmatter theme a11y checks + snapshots-- ACTIVATE!

* test: fix file name and path

* fix(#7317): scott bell prophecy

* jk no credit for u

* chore: disable parallelism until we figure out what's going on

* chore: set parallelism to 2 in hopes it fixes percy

---------

Co-authored-by: Hill, John (ARC-TI)[KBR Wyle Services, LLC] <john.c.hill@nasa.gov>
Co-authored-by: Jesse Mazzella <jesse.d.mazzella@nasa.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:maintenance tests, chores, or project maintenance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant