Why is the test for linux including build tasks?
Closed this issue ยท 3 comments
I was looking at the integration tests and i don't understand wha the code for the linux tests is at it is
terraform-switcher/.github/workflows/build.yml
Lines 35 to 45 in fe07d8b
I looks like it is
- get dependecies (what should be done with actions/setup-go already
- go vet (which might be useful for windows tests too)
- go test (necessary of course)
- create build dir (why?)
- build tfswitch (again why? these are integration tests)
- create /bin dir (why?)
- iterate the test-data folders and execute the built binary with them as changedir params. (i can see that this MIGHT be useful, but this should be covered in the test definitions. Did that in #356)
Maybe there is something i don't get. If that is the case: please enlighten me ๐
If that is a good approach: Why not doing it with windows test as well?
As of look of it, this bit comes from the past and suspectedly was used to test switching different TF versions with fresh-built tfswitch
.
create build dir (why?)
Maybe older versions of Go couldn't create output dirs? ๐ค
build tfswitch (again why? these are integration tests)
To use freshly built binary to conduct tests ๐บ
create /bin dir (why?)
To prevent tfswitch
from failing on non-existent dest dir for -b
cmdline option.
I tried my best in theoretical reasoning ๐
Probs @warrensbox can try and recall why that is as it is.
@MatrixCrawler this was implemented awhile back. I think @jukie helped with this tests. It was more of an integration test.
I am open to switching it to unit tests - like what you were doing with #356
Thanks for optimizing the test as well.
Tanks for the info ๐