-
-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Roc test can now support multiple files #6967
base: main
Are you sure you want to change the base?
Conversation
Seems that you have a clippy error. Can you fix this and run
Also, please sign your commits, a guide for which can be found in our CONTRIBUTING.md document. |
d85b534
to
8baf196
Compare
I need to read the docs! 😆 |
Debugging time! |
8baf196
to
ebee648
Compare
I'm not quite sure what was wrong with the pipeline. The test passing on my machine. I just did a rebase with the latest commit. I'm hoping that fixes it. |
c3d684e
to
78afd36
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this @jfkonecn, it's looking good. I played with this a bit and found a few things that were unexpected. Would you mind looking into these?
I tried to run this on a folder but got an error. I was expecting this behaviour
if you specify a folder, it's like running roc test on each .roc file in that folder
$ cargo run -- test examples/
── FILE PROBLEM in examples/ ───────────────────────────────────────────────────
I tried to read this file:
examples/
But ran into:
is a directory
I ran agains multiple files, it prints out No expectations were found.
multiple times. I was expecting this to just print once.
$ cargo run -- test examples/platform-switching/*.roc
Running `target/debug/roc test examples/platform-switching/main.roc examples/platform-switching/rocLovesC.roc examples/platform-switching/rocLovesRust.roc examples/platform-switching/rocLovesWebAssembly.roc examples/platform-switching/rocLovesZig.roc`
No expectations were found.
No expectations were found.
No expectations were found.
No expectations were found.
No expectations were found.
No expectations were found.
When I specific only two files, it printed out three times.
$ cargo run -- test examples/platform-switching/rocLovesZig.roc examples/platform-switching/rocLovesRust.roc
Finished dev [unoptimized + debuginfo] target(s) in 0.41s
Running `target/debug/roc test examples/platform-switching/rocLovesZig.roc examples/platform-switching/rocLovesRust.roc`
No expectations were found.
No expectations were found.
No expectations were found.
crates/cli/src/lib.rs
Outdated
@@ -498,18 +499,20 @@ pub fn test(matches: &ArgMatches, target: Target) -> io::Result<i32> { | |||
Some(n) => Threading::AtMost(*n), | |||
}; | |||
|
|||
let path = matches.get_one::<PathBuf>(ROC_FILE).unwrap(); | |||
// let path = matches.get_one::<PathBuf>(ROC_FILE).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this left here by mistake?
Thanks for the review! I'll take a look. |
32c5ca3
to
bd1b7c3
Compare
@lukewilliamboswell I've addressed you comments. I'm happy to do any code clean up you want me to do even if you think it's a minor issue. |
bd1b7c3
to
3ade4ff
Compare
Thank you @jfkonecn When I run it against the
|
Alright more debugging! 😆 |
@agu-z -- would you be able to look at this? I'm interested to know if we should log a separate issue and merge this PR as is? Below is the assertion that is being hit. This seems unrelated to the changes in this PR.
|
@lukewilliamboswell on the latest commit of main does your code generate the same error if you run |
@lukewilliamboswell I'm sorry I hadn't seen this. Do you suspect this is related to one my changes? |
@lukewilliamboswell @jfkonecn You can reproduce this on roc test examples/virtual-dom-wip/platform/server-side.roc When you run There seems to be a |
3ade4ff
to
a414d90
Compare
a414d90
to
4e50795
Compare
Closes #5103
I didn't do any fancy. I just loops through all the passed file. Let me know if you want me to do something else.