Your_program.sh in rust needs the --quiet flag

Stumbled upon that issue when trying the Shell challenge in Rust.
If you run `codecrafters test`, the tests will fail because the first output is from the compiler and not from the program itself.

Adding --quiet to the compiler options solves the issue

Hey @gfontorbe, looks like your repo was created a while ago. We’ve since updated how the tester runs repos, which unfortunately broke compatibility. Sorry about that.

The easiest fix is to restart the challenge and copy your Rust code over to the new repo. Just avoid copying project/config-related files.

Let me know if you still run into any issues.

I did try that already but it led to the same result unfortunately

Gotcha. I can see there are multiple repos on your account, and your latest submissions have actually succeeded.

Could you verify that the remotes in your local repo match the newly created remote repo?

Remotes are matching, I will try to delete the repository and start anew. Will keep you updated.

@andy1li Just deleted the repos. Created a fresh new one. Using `codecrafters test` is failing with the same issue as before.

Initiating test run...

⚡ This is a turbo test run. 

Running tests on your code. Logs should appear shortly...

[compile] Compilation successful.

[tester::#OO8] Running tests for Stage #OO8 (Print a prompt)

[tester::#OO8] Running ./your_program.sh

[your-program]    Compiling codecrafters-shell v0.1.0 (/app)

[tester::#OO8] ^ Expected prompt ("$ ") but received "   Compiling codecrafters-shell v0.1.0 (/app)"

[your-program]     Finished `release` profile [optimized] target(s) in 0.12ss-shell(bin)

[tester::#OO8] Test failed

NOTE: This failure is expected! Uncomment code in src/main.rs.

As you can see the first output from the program is a compiler log. Adding the --quiet flag leads to the expected test result (test still failing because the code is commented out but showing no program output)

Thanks for debugging this with me!

This is definitely unexpected, and I can see your latest submission on our end. What’s interesting is that after cloning your repo, I’m seeing a different result:

For comparison:

I’ve just reset your test runner instances. Could you try adding some debug logs like these:

And share the output you get? Here’s mine for reference:

That should help us narrow down where the difference is coming from.

@gfontorbe Did you perhaps delete the .codecrafters folder before running the tests? :sweat_smile:

.codecrafters directory is still there with the compile and run files inside.

I added logs to those files but they aren’t showing up when running the CLI.

Seems like the the CLI calls your-program.sh instead of going through the scripts in the .codecrafters directory.

I used the curl command written in the “Local Setup” stage to install/update the CLI beforehand, here is the version currently on my machine: v54-892884b

Thanks for checking, that’s really helpful!

Quick thing to double-check: do you happen to have .codecrafters and .gitignore patterns in your global gitignore (e.g. ~/.gitignore_global)?

Nice catch, I had an old gitignore file registered as my global gitignore.

All working as expected now, thanks a lot!