Skip to content

Background Jobs Stage 3-4#234

Open
UdeshyaDhungana wants to merge 30 commits intobg-jobsfrom
bg-jobs-2
Open

Background Jobs Stage 3-4#234
UdeshyaDhungana wants to merge 30 commits intobg-jobsfrom
bg-jobs-2

Conversation

@UdeshyaDhungana
Copy link
Contributor

@UdeshyaDhungana UdeshyaDhungana commented Feb 24, 2026

Note

Medium Risk
Adds new background-jobs stages and updates jobs output matching rules (markers/format and trailing &), which can change pass/fail behavior for multiple stages and fixtures. CI test execution is also switched to a Docker-based runner, which may introduce environment-related test differences.

Overview
Adds Background Jobs Stage #3 (jd6) and Stage #4 (dk5) to validate jobs output for one and multiple running background jobs, including correct +/- markers and ordering.

Tightens and refactors JobsBuiltinResponseTestCase expectations (renames ExpectedOutputItems to ExpectedOutputEntries, requires the trailing & for Running entries while still allowing a regex fallback) and updates fixtures/scenarios to cover incorrect marker and output-format failures.

Updates stage registration (tester_definition.go), course metadata (course_definition.yml), Makefile stage list, and switches the GitHub Actions test job to run tests via ./docker_test/docker_test.sh instead of a native Go setup.

Written by Cursor Bugbot for commit 21336ff. This will update automatically on new commits. Configure here.

Copy link
Member

@rohitpaulk rohitpaulk left a comment

Choose a reason for hiding this comment

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

Let's add failure test cases

@cursor

This comment has been minimized.

@codecrafters-io codecrafters-io deleted a comment from cursor bot Feb 25, 2026
@cursor

This comment has been minimized.

cursor[bot]

This comment was marked as outdated.

@codecrafters-io codecrafters-io deleted a comment from cursor bot Feb 26, 2026
[tester::#DK5] Running ./your_shell.sh
[your-program] $ sleep 100 &
[your-program] [1] 2375
[tester::#DK5] ✓ Received entry for the started job
Copy link
Member

Choose a reason for hiding this comment

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

"entry" here doesn't quite make sense - would just say "Output includes job number with PID." or something like that

[tester::#DK5] ✓ Received entry for the started job
[your-program] $ jobs
[your-program] [1]+ Running sleep 100 &
[tester::#DK5] ✓ Received 1 entry for the running jobs
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
�[33m[tester::#DK5] [0m[92m✓ Received 1 entry for the running jobs�[0m
�[33m[tester::#DK5] [0m[92m✓ Received 1 entry for the running job�[0m

(singular)

[your-program] $ jobs
[your-program] [1]- Running sleep 100 &
[your-program] [2]+ Running sleep 200 &
[tester::#DK5] ✓ Received 2 entries for the running jobs
Copy link
Member

Choose a reason for hiding this comment

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

I think we're overusing the "Received" word here, maybe the word "found" is shorter and more descriptive of what the assertion is doing? "Found 2 entries matching running jobs", or just "✔︎ 2 entries match running jobs".

[tester::#DK5] Running ./your_program.sh
[your-program] $ sleep 100 &
[your-program] [1] 2549
[tester::#DK5] ✓ Received entry for the started job
Copy link
Member

Choose a reason for hiding this comment

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

Same note as above - let's not use the word entry here

[your-program] [1]- Running sleep 100 &
[tester::#DK5] ^ Line does not match expected value.
[tester::#DK5] Expected: "[1]+ Running sleep 100 &"
[tester::#DK5] Received: "[1]- Running sleep 100 &"
Copy link
Member

@rohitpaulk rohitpaulk Feb 26, 2026

Choose a reason for hiding this comment

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

This is fine for now, but I can imagine a lot of confusion stemming from the usage of spaces here - if the user users a single space between each but has another mistake, it might look like we're complaining about spaces when we're complaining about something else.

Can't think of a neat way to solve this, but I think one way would be to use LLMs. We could expose this via the stage harness and find a mechanism to do restricted prompts (i.e. we have some guarantees over what kind of output they can emit). Then we could generate error messages like "missing space between - and Running"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted - Adding this to linear.

cursor[bot]

This comment was marked as outdated.

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