#JV1 | Error running tests | Go

I’m stuck on Stage #JV1

I’ve tried the exact same test manually in local, and I think I get the right output, so that’s why I’m very confused.

Here are the logs from the tests execution of JV1:

remote: Running tests on your code. Logs should appear shortly...
remote:
remote: [compile] Moved ./.codecrafters/run.sh → ./your_program.sh
remote: [compile] Compilation successful.
remote:
remote: [tester::#JV1] Running tests for Stage #JV1 (Redirection - Redirect stdout)
remote: [tester::#JV1] Running ./your_program.sh
remote: [tester::#JV1] Writing file "/tmp/foo/banana" with content "banana"
remote: [tester::#JV1] Writing file "/tmp/foo/mango" with content "mango"
remote: [tester::#JV1] Writing file "/tmp/foo/pineapple" with content "pineapple"
remote: [your-program] $ ls -1 /tmp/foo > /tmp/qux/baz.md
remote: [your-program] $ cat /tmp/qux/baz.md
remote: [your-program] banana
remote: [your-program] mango
remote: [your-program] pineapple
remote: [tester::#JV1] ✓ Received redirected file content
remote: [your-program] $ echo 'Hello Maria' 1> /tmp/qux/qux.md
remote: [your-program] $ cat /tmp/qux/qux.md
remote: [your-program] Hello Maria
remote: [tester::#JV1] ✓ Received redirected file content
remote: [your-program] $ cat /tmp/foo/mango nonexistent 1> /tmp/qux/quz.md
remote: [your-program] $
remote: [tester::#JV1] Output does not match expected value.
remote: [tester::#JV1] Expected: "cat: nonexistent: No such file or directory"
remote: [tester::#JV1] Received: "$ "
remote: [tester::#JV1] Assertion failed.
remote: [tester::#JV1] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)

My code is uploaded to GitHub - pabloprz/codecrafters-shell-go

This is my “local” execution running my code:

$ mkdir /tmp/foo
$ echo mango > /tmp/foo/mango
$ cat /tmp/foo/mango
mango
$ mkdir /tmp/qux
$ cat /tmp/foo/mango nonexistent 1> /tmp/qux/quz.md
cat: nonexistent: No such file or directory
$ cat /tmp/qux/quz.md
mango
$

From the test error it seems like a newline is printed instead of the cat error, but that’s not what I reproduce manually executing my code.

Any help is very much appreciated, thanks!

Thanks for the link to your code! I’ll take a look shortly.

I have the same error. have you found a solution to this? thanks :slight_smile:
(this is my github repo GitHub - giacomo-folli/codecrafters-shell)

Same issue here. Looks like some issue with the tests.

Can confirm that this is likely an issue with the tests! We’re looking into this.

1 Like

We’ve addressed a bug in our custom ls and cat executables that was causing incorrect exit codes in error scenarios.
The fix is available in pull request #102

2 Likes

@ajpagente @giacomo-folli @pabloprz could you folks try again please, let us know if the fix worked? We did test against one user submission to verify, but not sure if there are cases we haven’t handled.

1 Like

All works well now. thanks a lot :smile:

2 Likes

Ok I’ve been able to rerun the tests and everything worked! Thanks a lot for the quick turnaround!

2 Likes

Worked for me too. Thank you :smile:

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.