Closed Antosser closed 7 months ago
@Antosser will update CI workflow so I can test this against that.
@Antosser please provide a moro descriptive PR title.
I added a workflow to run tests with cargo test
You just have to uncomment when rebasing! Thanks in advance!
Why use bats? Have never heard of it. Wouldn't it be easier to write the tests in Rust? @EstebanBorai
Why use bats? Have never heard of it. Wouldn't it be easier to write the tests in Rust? @EstebanBorai
Bats allows us to test commands using the CLI just like the user will do.
For integration/unit tests we continue to use Rust.
Tests that you fixed, for instance, will remain.
@EstebanBorai It only works for UNIX though. And I still don't understand: Why do the integration tests not get run when I do cargo test
?
@EstebanBorai It only works for UNIX though. And I still don't understand: Why do the integration tests not get run when I do
cargo test
?
Hi @Antosser!
I don't see tests running in this CI session, have you tried rebasing?
@EstebanBorai It only works for UNIX though. And I still don't understand: Why do the integration tests not get run when I do
cargo test
?Hi @Antosser!
I don't see tests running in this CI session, have you tried rebasing?
I don't mean here on GitHub. I mean when I run them locally
Hey @Antosser! I did some rearrangement on integration tests here: https://github.com/http-server-rs/http-server/pull/404.
Those tests should run programmatically, but they depend on having a HTTP Server running with certain configuration.
So I was thinking about spawning a process for them and kill the process after running the test. I will see if theres something better or fallback to that if Im not able to find a solution soon.
WRT windows compatibility, have you ever used WSL2? Nowadays is perhaps the de-facto dev setup on Windows.
Hey @Antosser! I did some rearrangement on integration tests here: #404.
Those tests should run programmatically, but they depend on having a HTTP Server running with certain configuration.
So I was thinking about spawning a process for them and kill the process after running the test. I will see if theres something better or fallback to that if Im not able to find a solution soon.
WRT windows compatibility, have you ever used WSL2? Nowadays is perhaps the de-facto dev setup on Windows.
Thinking deeper, these tests on /test
actually don't make sense now that we have bats.
Hey @Antosser! I did some rearrangement on integration tests here: #404.
Those tests should run programmatically, but they depend on having a HTTP Server running with certain configuration.
So I was thinking about spawning a process for them and kill the process after running the test. I will see if theres something better or fallback to that if Im not able to find a solution soon.
WRT windows compatibility, have you ever used WSL2? Nowadays is perhaps the de-facto dev setup on Windows.
Rust can do all that
Hey @Antosser! I did some rearrangement on integration tests here: #404.
Those tests should run programmatically, but they depend on having a HTTP Server running with certain configuration.
So I was thinking about spawning a process for them and kill the process after running the test. I will see if theres something better or fallback to that if Im not able to find a solution soon.
WRT windows compatibility, have you ever used WSL2? Nowadays is perhaps the de-facto dev setup on Windows.
Rust can do all that
Thats right. Actually every programming language can do it.
But its more about the approach and the resources.
With Bats its not required to recompile on test changes.
Another good point is that we want to mimic user experience, using bash we are using the exact same approach as the user.
And bash is very powerful and easy to write.
I guess these are tests that only don't pass on Windows, because the paths are different
Tho, it's still important to fix since a portion of users will still run this on Windows
Should I close since we've switched to bats?
I really want to develop this app further
I really want to develop this app further
Hey @Antosser! It would be nice to have CLI tests somehow, feel free to share ideas in a GitHub Discussion here: https://github.com/http-server-rs/http-server/discussions/413
Fixed 4 of the 7 failed tests. All of them have to do with paths, which work differently depending on the OS. I still have no idea how to fix the other 2.
cargo test
:I still don't understand why integration tests don't get run