Replace bash with cargo-make#1504
Conversation
|
I think the issue is to do with a mismatch with the feature flags. |
|
thanks, so should use default feature for the check, or should that be fixed in that member? |
|
The --- a/yewtil/examples/pure_component/Cargo.toml
+++ b/yewtil/examples/pure_component/Cargo.toml
@@ -9,4 +9,4 @@ license = "MIT/Apache-2.0"
log = "0.4.8"
wasm-logger = "0.2.0"
yew = { path = "../../../yew" }
-yewtil = { path = "../.." }
+yewtil = { path = "../..", features = ["pure"] } |
|
This looks great so far! Much more complex than I had anticipated so I can't thank you enough for your help. One thing that sticks out to me right now is the amount of console output. Running Speaking of the log level, you're running |
|
thanks a lot for the feedback. you are raising great points and i'll try to answer. console logs - i get that alot actually. many people want less. on the other hand, i'm getting the opposite requests, for example there is one open issue now from someone that requested time summary per task (i implemented it but its not on by default) and others wanted to know if a task is skipped than to printout why and so on... cli args - good observation :) complexity - i think most complexity comes from the fact that this project has some non standard structure. you have a workspace inside a workspace. |
|
@siku2 did more improvements which are based on new cargo-make version which is still in development (will be releasing it this week). cargo install --force --git https://github.com/sagiegurari/cargo-make --branch 0.32.2console output - this one should be resolved. i greatly reduced unneeded logs. give it a try and compare cli args - that duel workspace you have is a bit problematic for me, but i think this one should be ok now. i'm passing the important stuff on and the rest is automatically passed via env. I'll probably try to tackle more scripts if the overall approach seems relevant for you. also, i saw in the original issue there was a question if cargo-make is mature. so apart of the fact its there for around 3 years, it is very much in use by many projects.
And few more |
That's really cool! It seems like we're down to just under 700 lines now. Still a lot, but cutting it in half is a great achievement.
Haha, tell me about it. Glad to hear that cargo-make is up to the task.
Yes, this looks great so far, please do. The most important script left is I would love to use cargo-make for the entire CI in the future and that will require some additional tasks. I'll gladly do those myself though - wouldn't want to take up too much of your time. So TL;DR, it would be great if you could add a task for running the tests ( |
|
I'll take a look at it. thanks for the feedback :) |
|
@siku2 i have implemented (i hope) the run tests as well but need your help testing it fully. the new run-tests task will also automatically install wasm binary if needed. i have excluded all example members from the tests since i see you test very specific members (i took the reverse approach of saying what not to test) |
|
Great, I will take a look and let you know if it's working :) |
|
Okay, it looks like everything is working! There's one thing left that I'm hoping cargo-make might be able to deal with and that's managing the httpbin Docker container for the integration tests. Ideally it should work like this:
Not sure how much work it is to implement this so do tell me if you don't have the time. |
|
thanks for checking. so for the docker stuff, it sounds like simple scripting i can add to the makefile. |
You have to understand that these scripts are ancient and were only designed for Travis initially. In an earlier version of the script there wasn't even a check for the
Starting a container from a cached image shouldn't take long at all, especially not compared to the time it takes to run the tests in the first place.
We used that a while back but it suddenly stopped working correctly. I don't remember what was broken exactly but our tests kept failing. |
|
cool, thanks for the answers. I'll try to see what i can do. |
|
@siku2 I implemented the docker start/stop. it was pretty simple but fully testing it is not possible for me so again i'll have to use your testing skills :) apart of that, i think this PR is ready for review. I think all the stuff we wanted to push for first iteration is there and ready. |
Co-authored-by: Simon <simon@siku2.io>
|
@siku2 I'll probably need few more days for the docker cleanup comment (a bit busy). |
Take your time :) Out of curiosity, wouldn't it make sense to add native support for this to cargo-make? I imagined it something like this: [tasks.run-tests]
dependencies = ["tests-setup"]
env = { CARGO_MAKE_WORKSPACE_SKIP_MEMBERS = ["examples/*", "yewtil/examples/*"] }
run_task = { name = [ "run-tests-flow", "run-tests-stdweb" ], fork = true }
cleanup_task = "tests-cleanup"Where the task given to |
|
i agree it would be better, but unfortunately that would require big design changes. |
|
@siku2 the cleanup task is now implemented. |
There was a problem hiding this comment.
i didn't delete the old shell files or updated the docs, so its running side by side until you feel its ok to do the switch.
That's alright, I'll take care of that. My plan is to replace the old scripts right away but then there's still some work to be done before we can use it for CI too.
One thing I would like to point out is that the cleanup_task doesn't run if the task is cancelled for instance with SIGINT (CTRL+C). That doesn't hold back this PR but I think cleanup should run in that case too.
There is one last issue that I caused by using a random port for the httpbin server: cargo doesn't detect changes to the content of env! macro variables so the tests won't use the correct URL if nothing else caused a rebuild.
The only solution I can come up with on the spot is to use include_str! (which does detect changes AFAIK) and write the HTTPBIN_URL to a file instead. This solution seems a bit convoluted to me so I want to look into other solutions first.
Other than that I think this is good to go!
Feel free to ping me if you need help with that, or if we need new features in cargo-make
I think the best way forward is to change that to env::var call and not env! macro. so you pick up the right value during execution, not during compilation. thanks a lot for all the reviews and comments 😃 |
I should've mentioned that this sadly isn't possible. The tests run in the browser so we can't access the environment variables at runtime. |
woops. ya, challenging. so... instead of random, maybe we should use a fixed port value always. |
|
I suppose that's the best option for now but it hurts to see the beautiful port detection logic removed 😄. |
|
@siku2 so based on our talk i did 2 more changes
|
siku2
left a comment
There was a problem hiding this comment.
Alright, it looks like we're pretty much good to go then.
|
@sagiegurari I did some final testing and I ran into a problem. It seems like "tests-cleanup" already runs before "run-tests-stdweb" does, so when the fetch service tests run for yew-stdweb there's no longer an httpbin server around. The output looks like this: ... other tests ...
[cargo-make][1] INFO - Build Done in 58 seconds.
[cargo-make] INFO - Execute Command: "docker" "rm" "--force" "<snip>"
[cargo-make] INFO - Execute Command: "cargo" "make" <snip> "run-tests-stdweb"
[cargo-make][1] INFO - Task: run-tests-stdweb |
|
I'll check that. its a new thing (cleanup_task inside run_task). maybe there is a bug there... |
|
Found the issue, publishing an update in few minutes... |
|
should be fine now. thanks for testing :) |
|
This time I'm confident everything is working. Thanks so much for all the work you put into this! |
Description
See #1418
Basically this first draft only replaces the run_stable_checks script to cargo make.
In addition it also installs rustfmt, clippy and cargo-web if missing.
You can run it from the root as
cargo make stable-checksBy the way, one of the member crates is failing on cargo check.
Fixes # (issue)
Checklist:
./ci/run_stable_checks.sh. - sort of, i rancargo make stable-checks