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

Passed/failed for assertion results in TestRenderer and migrate to pass/fail for report comparison algorithms #847

Merged
merged 8 commits into from
Nov 29, 2023

Conversation

stalgiag
Copy link
Contributor

see #736

This PR does the following:

  • Changes input elements for test runs to a fieldset with checkbox inputs.
  • Updates test rendered component to use correct input change callbacks on updated assertion data structure
  • Updates result comparison algorithm so that it no longer takes failedReason into account when calculating conflicts

For reviewers, the client/resources changes are not relevant to this PR and have been reviewed elsewhere.


const AssertionsFieldset = ({ assertions, commandIndex, assertionsHeader }) => {
// Handle case where build process didn't include assertionResponseQuestion
const normalizedHeader = useMemo(() => {
Copy link
Contributor Author

@stalgiag stalgiag Nov 21, 2023

Choose a reason for hiding this comment

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

The value from support.json wasn't being correctly included with test commands in assertionsHeader.descriptionHeader. I am not sure but my sense is that this isn't from changes in this PR but instead comes from the state of the work that this PR is built upon. If this isn't the case, let me know. Either way this calculation handles the issue and it can become a tiny tech debt task after all of the v2 changes have landed.

Copy link
Contributor

@howard-e howard-e Nov 21, 2023

Choose a reason for hiding this comment

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

The renderer in this app has to be built on top of the individual collected json files. Architecturally, that means the .collected.json for any of these tests have to include the relevant data. Looking into this, it's clear there is some extending that can happen here to support that. The same issue is present when viewing a example collected test.

Copy link
Contributor

@howard-e howard-e Nov 21, 2023

Choose a reason for hiding this comment

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

@stalgiag I've submitted w3c/aria-at#1005 as a potential fix. Let me know your thoughts.

There's other potential tech debt I've noticed, that may come up during future v2 format support work, that I think we can handle as they arise.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looking again at how this is used, I'm also not against just explicitly depending on the support.json in this use case. It should always be up to date because of the import 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.

Let's leave as-is for now and I'll check out #1005 for sweeping this up later. Definitely would be nice to avoid the weirdness of looking for the undefined value here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Circling back around - It doesn't seem that collectedText.supportJSON is coming through with the changes in #1005. I can look more into this next week if we think it is important to handle now.

Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't seem that collectedText.supportJSON is coming through with the changes

The supportJson attribute would be added in the object called by the following line as well:

await testRunIO.setInputsFromCollectedTestAsync(renderableContent)

if we think it is important to handle now.

I don't right now. Still fully onboard with just calling it from the available support.json.

Copy link
Contributor

@howard-e howard-e left a comment

Choose a reason for hiding this comment

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

These changes look good to me. Although I imagine in the future, we'll want to clean up references to failedReason.

Also I think these references to failedReason being updated in the harness' state may need to be updated to be safe? I imagine it's something like the following based on your other changes:

                 if (assertionResult.passed)
                     commands[i].assertions[j].result = 'pass';
-                else if (assertionResult.failedReason === 'NO_OUTPUT')
-                    commands[i].assertions[j].result = 'failMissing';
-                else if (assertionResult.failedReason === 'INCORRECT_OUTPUT')
-                    commands[i].assertions[j].result = 'failIncorrect';
-                else commands[i].assertions[j].result = 'notSet';
+                else commands[i].assertions[j].result = 'fail';


const AssertionsFieldset = ({ assertions, commandIndex, assertionsHeader }) => {
// Handle case where build process didn't include assertionResponseQuestion
const normalizedHeader = useMemo(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking again at how this is used, I'm also not against just explicitly depending on the support.json in this use case. It should always be up to date because of the import script.

@stalgiag
Copy link
Contributor Author

stalgiag commented Nov 22, 2023

These changes look good to me. Although I imagine in the future, we'll want to clean up references to failedReason.

Also I think these references to failedReason being updated in the harness' state may need to be updated to be safe? I imagine it's something like the following based on your other changes:

                 if (assertionResult.passed)
                     commands[i].assertions[j].result = 'pass';
-                else if (assertionResult.failedReason === 'NO_OUTPUT')
-                    commands[i].assertions[j].result = 'failMissing';
-                else if (assertionResult.failedReason === 'INCORRECT_OUTPUT')
-                    commands[i].assertions[j].result = 'failIncorrect';
-                else commands[i].assertions[j].result = 'notSet';
+                else commands[i].assertions[j].result = 'fail';

Thanks for this! I forgot that this value is not just excluded from v2, it is being deprecated from use across all test versions. This allowed me to more destructively remove the references. I only left them in two locations:

  1. GraphQL schema, just as documentation to explain the DB
  2. populateTestData functions. Perhaps these will need to be removed. I was unsure of how much we want to rewrite our base local testing state.

This also means that there is some additional clean up that can happen upstream in the resources files in aria-at. I'll handle that next week.

@stalgiag stalgiag requested a review from howard-e November 27, 2023 16:50
@howard-e howard-e force-pushed the v2-test-format-testrun branch from cd1cdc9 to aaa628c Compare November 27, 2023 19:00
@howard-e
Copy link
Contributor

This also means that there is some additional clean up that can happen upstream in the resources files in aria-at. I'll handle that next week.

Sounds like a plan, thanks for being on top of that!

Base automatically changed from v2-test-format-testrun to support-v2-test-format November 29, 2023 17:25
@howard-e howard-e merged commit 495543d into support-v2-test-format Nov 29, 2023
2 checks passed
@howard-e howard-e deleted the pass-fail-test-run branch November 29, 2023 20:44
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