Closed
Description
So I've been looking into creating some projects lately, and these will be different from the tutorials.
I am wondering if we can add a way to do many tests at once. Basically, like you have multiple steps for one question. But instead of each step showing up after each test passes (I think that's how it currently is), all the tests (or steps) would be displayed from the start and when the tests were run, they would show pass/fail or some icons next to each test.
So when users create their projects, they can run the tests after they have worked on it for a while and see that they have passed 5 of 10 tests or something. This is similar to how fCC does it on projects.
Activity
ShMcK commentedon May 12, 2020
Since CodeRoad is based on Git, steps are required to go in a specific order.
However, it would be possible to relate a series of unit tests with a step "subtask". When those subtasks pass, the task passes. It's a fair bit of work, but doable.
ShMcK commentedon May 14, 2020
I've been thinking about this one.
Requirements
Display feature requires:
2 parsing the test names as "subtask" text
I'll address each of these below:
Solutions
Subset of Tests
Many test runners have the ability to run a subset of tests by:
These test run commands aren't consistent across test runners - meaning that they would have to be specified in a tutorial config. Likely in the
config.testRunner.testFilterCommand
.A step could indicate that it is using a test filter and could provide the filter string.
Test Names & Test Status
I parse the output in a format called "TAP" (Test Anywhere Protocol), so the subtask name can be taken from the test name, and the pass/fail status is recorded.
Process
moT01 commentedon May 15, 2020
Here's a couple scenarios that you may want to consider. I will likely want to be able to do all of these if possible. It sounds your plan would accommodate, but I just want to try and clarify.
A Project will likely look like this - Pretty much just one level with one step and many tests:
The tests would all be run at once, and users would be able to see what ones they pass/failed. If it's easier, you could maybe make it so it stops testing when the first one fails. Meaning the tests start running, it passes the first test (you get a green checkmark there), it fails on the second test, and the third test just doesn't execute.
Another scenario is to have multiple tests within a step of a regular challenge...
So step one would be the first test, they wouldn't be able to move past it until they passed. Then the second step might have several tests which all get tested at the same time. This is similar to what is on fCC and how I am familiar with writing instructions.
It sounds like your plan would accommodate both of these scenarios.
[-]Multiple tests at once[/-][+]"Subtasks": Multiple tests at once[/+]