Ph0enixKM / Amber

💎 Amber the programming language compiled to bash
https://amber-lang.com
GNU General Public License v3.0
3.51k stars 67 forks source link

Test `bash_error_exit_code` May Produce Inaccurate Results #217

Open arapower opened 1 week ago

arapower commented 1 week ago

Test bash_error_exit_code uses the binary file that was built just before. If you build the contents of a different branch, the test results will be incorrect.

Ph0enixKM commented 1 week ago

@arapower what does this reference to? I'm having a hard time to understand the issue

arapower commented 1 week ago

@Ph0enixKM Is it okay to have to build before running tests?

b1ek commented 1 week ago

@arapower what does this reference to? I'm having a hard time to understand the issue

if im understanding it right, what ara means is that it currently expects the following workflow: cargo b -> cargo test (which depends on target/debug/amber or whatever)

the problems unfold when the cargo b build is stale or doesn't exist at all

arapower commented 1 week ago

@b1ek Thanks for the explanation. You're right.

Ph0enixKM commented 1 week ago

@arapower @b1ek So what do you propose as a solution to that? I think that the PR creator can check why the test failed and will see that the build crashed or something else

arapower commented 1 week ago

It just seemed strange to me that the test results depended on the built binary. All developers just need to be careful. If that state is acceptable, I think it's fine to leave it as is.

There is a way to work around this. I'm just concerned that it's a workaround.

b1ek commented 1 week ago

There is a way to work around this.

perhaps it could call the main() function or something? im pretty sure that someone has already done something like that

Ph0enixKM commented 2 days ago

I'll mark it with milestone Stable Release for now