-
Notifications
You must be signed in to change notification settings - Fork 15
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
Conversation
2e34001
to
7114117
Compare
7114117
to
c0ba18e
Compare
client/components/CandidateReview/CandidateTestPlanRun/InstructionsRenderer.jsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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 { | ||
} | ||
`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed?
There was a problem hiding this comment.
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 🙂
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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)); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
} | ||
}); | ||
return settingsContent; | ||
}; |
There was a problem hiding this comment.
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!
There was a problem hiding this 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.
133ed89
to
8dd8119
Compare
cd1cdc9
to
aaa628c
Compare
Co-authored-by: Stalgia Grigg <[email protected]>
…nto v2-test-format-testrun
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