Closed evrardjp closed 3 years ago
This is not a bug-- the issue is that you didn't build the generated files before you ran the tests. To do this run make
. This is done automatically in our CI.
I ran make test
, like the documentation suggests.
if I check the Makefile, make test
has a dep on build, which should be good enough. Because I ran this in CI, I expected that the make build
ran and generated the proper content. Apparently I was wrong, and there is something no streamlined in the way the make runs in CI. Also: why the different code paths?
why the different code paths?
I don't know exactly what you're referring to, but if I was to guess, then the point is that you can run either:
1) make test
(from CI)
2) make
(build)
3) ./test/some_test_name.sh (run one individual test as user)
And any of these will ensure that the necessary deps are built.
If I didn't answer all your questions, please re-ask. I'm heading to bed shortly.
./test/some_test_name.sh (run one individual test as user)
Note, you can also auto-complete these with make test-<tab>
I will dig into why make test
, in CI, didn't generate the proper artifacts.
If I didn't answer all your questions, please re-ask. I'm heading to bed shortly.
Hahahaha :) IMO no software is worth cutting bed time. Talk to you another day! :)
fwiw, this could be made a bit clearer using go generate
to invoke the generator, or even make
so go build
can perform all of the compilation in one step
Without this patch, TEST_BLOCK="shell" make test will fail in CI, with "no Go files in go/src/github.com/purpleidea/mgmt/bindata".
This is a problem, as it will prevent us to move to github actions.
This should fix it, by creating an empty golang file.