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

Introduce automated tests #1105

Merged
merged 25 commits into from
Aug 21, 2024
Merged

Introduce automated tests #1105

merged 25 commits into from
Aug 21, 2024

Conversation

howard-e
Copy link
Contributor

@howard-e howard-e commented Aug 15, 2024

Preview Tests

This introduces tests which compare the snapshots of a 4 specific test plans which have been pulled into a dedicated __mocks__ folder:

  • alert (using v2 test format version)
  • banner (using v1 test format version)
  • command-button (using v2 test format version, with more complexity than alert)
  • horizontal-slider (using v2 test format version, which includes assertionExceptions)

This PR does significant restructuring of the create-all-tests and the review-tests scripts to make the results of those overall scripts testable (ie. content that gets added into the /build folder).

Additional tests can follow this PR to verify the many utilities and the harness output used in this project. To avoid ballooning this PR further, we can introduce this initial work and do the aforementioned tests as subsequent PRs to make future reviews easier.

Note: Also confirmed these changes don't cause any critical issues when being imported into aria-at-app. (build log)

@howard-e howard-e marked this pull request as ready for review August 15, 2024 16:50
@howard-e howard-e requested a review from stalgiag August 15, 2024 16:50
@howard-e howard-e changed the title Include automated tests Introduce automated tests Aug 15, 2024
Copy link
Contributor

@stalgiag stalgiag left a comment

Choose a reason for hiding this comment

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

Read through all of the changes and everything looks good! Also ran the test and love this new, easier entry point for interacting with the repo. The only two comments that I have are both non-blocking, nice-to-haves.

  1. createReviewPages.mjs feels like it could be broken up a little to make it easier to read. Some sections become deeply nested.
  2. The logging during testing is difficult to parse. I wonder if this could be helped with something simple like an emphasis color on the summary messages? This isn't essential but could be nice.

@@ -5,7 +5,12 @@ on:

jobs:
generate-and-commit-files:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!


// For V2 to handle assertion exceptions
assertionsForCommandsInstructions = assertionsForCommandsInstructions.map(
(assertionForCommand, assertionForCommandIndex) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This section is feeling deeply nested and it becomes a little tricky to follow. Perhaps there can be a dedicated function for processing each of the collectedTestsData? This could break it up a little bit and make it easier to follow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do!

@howard-e
Copy link
Contributor Author

  1. createReviewPages.mjs feels like it could be broken up a little to make it easier to read. Some sections become deeply nested.
  2. The logging during testing is difficult to parse. I wonder if this could be helped with something simple like an emphasis color on the summary messages? This isn't essential but could be nice.

Good point on both, will take a pass at making that content easier to parse

@howard-e
Copy link
Contributor Author

  1. createReviewPages.mjs feels like it could be broken up a little to make it easier to read. Some sections become deeply nested.

@stalgiag I added several commits to break up the createReviewPages.mjs into several smaller components. Let me know me know your thoughts there!

  1. The logging during testing is difficult to parse. I wonder if this could be helped with something simple like an emphasis color on the summary messages? This isn't essential but could be nice.

b333622 should address this. Please let me know if this aligns with what you were thinking. Also curious if you think this functionality should be set behind the test flag?

Copy link
Contributor

@stalgiag stalgiag left a comment

Choose a reason for hiding this comment

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

Wow you went above and beyond! Thanks for addressing the feedback. The new createReviewPages organization is much easier for me to follow with smart separation of responsibilities.

The log styling is great and I like it as-is. With scripts that produce lots of output, like this one, it is useful to err on the side of conveying more contextual/severity info where possible.

…figKeysTitleUnexpected. This doesn't affect the app because it uses fromCollectedTestCommandsKeysUnexpected
@howard-e
Copy link
Contributor Author

@stalgiag thanks for the feedback! Found a presumably long standing issue (but presentational) with how the assertionExceptions logic is handled in when built with the json data that I've addressed in c66455f. The gist being that json filtered view could show all the assertionExceptions if excluded in assertions.csv instead of *-commands.csv. The collected json view (which is also what the app uses) didn't have this issue.

screenshot showing json filtered view incorrectly showing 'jaws switched from virtual cursor active to pc cursor active' for 'down down' command

json filtered view incorrectly showing 'jaws switched from virtual cursor active to pc cursor active' for 'down down' command

screenshot showing collected json view correctly excluding 'jaws switched from virtual cursor active to pc cursor active' for 'down down' command

collected json view correctly excluding 'jaws switched from virtual cursor active to pc cursor active' for 'down down' command

Also re-confirmed these changes don't cause any critical issues when being imported into aria-at-app. (build log)

@howard-e howard-e merged commit 69f36d7 into master Aug 21, 2024
9 checks passed
@howard-e howard-e deleted the add-tests branch August 21, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In production / Completed
Development

Successfully merging this pull request may close these issues.

2 participants