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

Update Test Runner for V2 Test Format #843

Merged
merged 10 commits into from
Nov 29, 2023

Conversation

howard-e
Copy link
Contributor

@howard-e howard-e commented Nov 15, 2023

See #743. Based on #840.

This PR also updates <InstructionsRenderer> which was being used on the Candidate Test Plan Run page.

Dependent PRs to be merged

@howard-e howard-e changed the title V2 test format testrun Update Test Runner for V2 Test Format Nov 15, 2023
@howard-e howard-e force-pushed the v2-test-format-testrun branch 6 times, most recently from 2e34001 to 7114117 Compare November 16, 2023 22:39
@howard-e howard-e marked this pull request as ready for review November 16, 2023 22:40
@howard-e howard-e force-pushed the v2-test-format-testrun branch from 7114117 to c0ba18e Compare November 20, 2023 13:55
@howard-e howard-e requested a review from stalgiag November 21, 2023 14:46
@howard-e howard-e requested a review from alflennik November 21, 2023 16:50
Copy link
Contributor

@alflennik alflennik left a comment

Choose a reason for hiding this comment

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

Generally the code looks great! I did leave one pretty lengthy comment as you can see, about the location where we are persisting the testFormatVersion variable. I'm hypothesizing that it would be a large scale change requiring a lot of effort (I might be wrong) so that's why I went into more detail about why I think it's worth it.

Note I haven't yet been able to test this locally but I'm working on it.

@@ -216,6 +212,7 @@ const TestRenderer = ({
at,
testResult = {},
testPageUrl,
testFormatVersion = 1,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think my preference would be to make the testFormatVersion a required field, I feel like defaulting to v1 kind of sends a message that version 1 is privileged in some way or preferable, when that's not the case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in c29eef0

@@ -43,6 +43,7 @@
"react-bootstrap": "^2.7.0",
"react-dom": "^18.2.0",
"react-helmet": "^6.0.0",
"react-html-parser": "^2.0.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

Cool package 👍

const NumberedList = styled.ol`
> li {
}
`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope! Got caught copying and pasting 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in eab5ec8

@@ -1011,6 +1011,10 @@ const TestRun = () => {
)
}
testPageUrl={testPlanVersion.testPageUrl}
testFormatVersion={
testPlanVersion.metadata
.testFormatVersion
Copy link
Contributor

Choose a reason for hiding this comment

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

Big ask here: can the testFormatVersion be included inside the renderableContent?

It's a pretty sizable change, but here's my reasoning about why it might be worth it.

When contributors come across this variable, called testFormatVersion, the implication is that there can be multiple ways tests are formatted. It's right there in the name. So what's going to happen is that they are going to doubt whether they can rely on the documented concepts like "scenarios" and "assertions" and "tests" and "testResults."

As you know, in reality all these concepts are completely unaffected by the testFormatVersion. But it seems like they could be. That's the disconnect that I want to try to mitigate.

If the testFormatVersion was only accessible from within the renderableContent, A.K.A. renderableContent.testFormatVersion, suddenly it becomes immediately apparent where the safe zone ends and where the danger zone starts. It becomes obvious that if you are attempting to extract some kind of data from the renderableContent, you should make sure to account for all the versions that the data can be formatted.

There reason it is a big ask is that this field is not currently included in the renderableContent and I think it would need to be added in a migration. But furthermore, to do it right, it seems like going forward the field would need to be added into the build process of the ARIA-AT repo for both v1 and v2 build processes.

That's a lot, definitely reach out if I can clarify anything I said above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Answered by #840 (comment), which is also where that change would happen.

Copy link
Contributor

@stalgiag stalgiag Nov 22, 2023

Choose a reason for hiding this comment

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

I don't quite follow why the testFormatVersion would live on individual tests since it will be consistent across the collection in the parent.

Also v2 of the testFormatVersion doesn't affect "scenarios", "assertions", "tests", or "testResults" but a future version could. But then again, I could be totally misunderstanding the suggestion here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I decided to approve despite this comment, which might be motivated more from my misunderstanding than any genuine issue.

Comment on lines 137 to 148
allInstructions = [
renderableContent.target.at.raw
.defaultConfigurationInstructionsHTML,
`${supportJson.testPlanStrings.openExampleInstruction} ${renderableContent.target.setupScript.scriptDescription}.`,
`${renderableContent.instructions.instructions} ${
supportJson.testPlanStrings.commandListPreface
}${
commandSettingSpecified
? ` ${supportJson.testPlanStrings.commandListSettingsPreface}`
: ''
}`
].map(e => unescape(e));
Copy link
Contributor

Choose a reason for hiding this comment

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

I have a hard time seeing where an array item starts and stops here. This is mainly due to the fact that our project uses the default printwidth in prettier but maybe this could benefit from a couple of intermediate variables just to make the array easier to read.

Copy link
Contributor Author

@howard-e howard-e Nov 27, 2023

Choose a reason for hiding this comment

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

I have a hard time seeing where an array item starts and stops here. This is mainly due to the fact that our project uses the default printwidth in prettier

I'd love to increase this if we can find time to discuss on what's best. It has felt a bit much in other areas of the code I've across.

... benefit from a couple of intermediate variables just to make the array easier to read.

Done in da48e17 and 68e3eea

client/components/TestRenderer/utils.js Outdated Show resolved Hide resolved
}
});
return settingsContent;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Glad to have these in a separate file!

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.

I am still learning how the different parts of this app work with aria-at but I believethat I was able to get this up and view the changes without any issues.

Code feedback is minimal. Mostly everything looks good. All suggestions are optional so I am approving.

@howard-e howard-e force-pushed the support-v2-test-format branch from 133ed89 to 8dd8119 Compare November 27, 2023 15:27
@howard-e howard-e force-pushed the v2-test-format-testrun branch from cd1cdc9 to aaa628c Compare November 27, 2023 19:00
@howard-e howard-e merged commit 03c6f39 into support-v2-test-format Nov 29, 2023
2 checks passed
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