MysteryBlokHed / databind

Expand the functionality of Minecraft Datapacks.
https://databind.rtfd.io/en/stable
GNU General Public License v3.0
4 stars 0 forks source link

Make tests properly use `--release` flag #118

Closed MysteryBlokHed closed 3 years ago

MysteryBlokHed commented 3 years ago

All of the integration tests use cargo run and test the output, but none of them pass the --release flag to cargo run when the tests were run with the release flag. The best environment variable I've found to help with this is CARGO_BIN_EXE_databind, which contains the path of the built binary. Removing the filename from the end of the path would give you the path to a folder named either debug or release, which could be used to tell whether to pass the release flag to cargo run.

Currently, the tests take longer than the build step of the Build And Test workflow since it has to rebuild the binary without release optimizations. Implementing this could save some time, especially on workflow runs that don't have a cache.