Preserve test run history
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 62/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript
Research direction
Start in web/interview.js, where the Run tests handler and the Markdown export call reportMarkdown(), then read web/runners.js to see how each test result object is built, including where input is set only for custom or failed cases. Next, check web/render.js to see how the report is assembled. Done means each run is appended to a testHistory array, passing cases keep their input, and a Test Run History section appears in the exported Markdown, with regression tests under tests/browser/ covering it.
Written by the indexing model from the issue text.
Description
Description
Currently, the interview report only preserves the candidate's final version of the code. Intermediate code changes, failed test runs, and error messages during the interview are not fully recorded.
This makes it difficult for candidates to review their mistakes after the interview, understand why their solutions failed, and reflect on how they could improve their problem-solving approach.
Expected Behavior
- Record each test run when the candidate clicks Run tests.
- Preserve the timestamp, test results, expected values, actual values, and available error messages for each run.
- Include a code snapshot only when the code differs from the previous test run, avoiding unnecessary duplication.
- Keep only the 10 most recent test runs to limit the size of the exported Markdown report.
- Include the test run history in the final Markdown interview report, alongside the existing final code and interview transcript.
- Preserve previous records within the retained history instead of overwriting them with the latest test results. Display the additional records only in the Markdown report without adding them to Past Attempts Reports.
Proposed Solution
1. Record test run history
Update web/interview.js to add a testHistory array to the interview state.
Before executing tests, capture the current code, programming language, and timestamp. After execution, append a record containing:
- Run number and timestamp
- Programming language
- Code snapshot, if the code has changed since the previous run
- Number of passed and total tests
- Setup errors and individual test case results
- Available input values, expected outputs, actual outputs, and error messages
After recording each run, retain only the 10 most recent entries.
2. Avoid duplicate code snapshots
Compare the current code with the code from the previous test run.
- If the code has changed, save a new code snapshot.
- If the code has not changed, record the test results without duplicating the code snapshot.
This reduces the size of the exported report while preserving meaningful code changes.
3. Include test history in the Markdown report
Update web/render.js to accept a testHistory parameter and generate a Test Run History section.
Each run should include its timestamp, test summary, available test case details, and a code snapshot when applicable.
Update the Markdown export function in web/interview.js to pass state.testHistory to reportMarkdown().
The existing final code section and interview transcript should remain unchanged.
4. Add regression tests
Update the relevant tests under tests/browser/.
Example Result
- Dominant language
- Rust
- Stars
- 160
- Forks
- 64
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 116
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sysprog21/codetrial
-
Four problem loader browser tests fail on WindowsPossibly taken @Patriciaath999 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sysprog21/codetrial#322 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
sysprog21/codetrial#318 · 2 comments · 2 reactions ·
Maintainers usually reply within 1 day
-
Show local time in past attempt labelsPossibly taken @jin11109 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sysprog21/codetrial#317 · 2 comments · 1 reaction · 1 assignee ·
Maintainers usually reply within 1 day
-
Highlight the active line in the code editorPossibly taken @ArthurArthurArthur0817 claimed this 10 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
sysprog21/codetrial#247 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Let the candidate undo Continue without camera in the preflightPossibly taken @HALA1028 claimed this 1 day ago. Open
sysprog21/codetrial#327 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in sysprog21/codetrial
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EmbarkStudios/cargo-deny#910 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tursodatabase/turso#10054 ·
Maintainers usually reply within 1 day
-
build: Update rust versionPossibly taken A pull request linked to this issue is open or already merged. Opendependencies
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
ibm-granite-community/granite-cli#229 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
orottier/web-audio-api-rs#658 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
aosama/astronomical#1318 ·
Maintainers usually reply within 1 day