cli icon indicating copy to clipboard operation
cli copied to clipboard

test: integration build the ignite binary (WIP)

Open tbruyelle opened this issue 3 years ago • 4 comments

Previously, the ignite binary was supposed to be present in the path, which can be error prone if the binary is not up to date with the integration version.

The change builds the binary before the integration are run, using a init() function. This is not very adequate since the binary is not removed at the end of the test. To be able to remove it at the end of the tests we could:

  1. add a TestMain in each integration sub-package: not super fan of this because it involves to repeat the same code for each package
  2. move all tests in the same package: preferable but delete the separation between the tests.

If someone could give me a hint on this, it would be nice!

Fix #2635

tbruyelle avatar Jul 20 '22 15:07 tbruyelle

I think moving the tests to the same package is fine. We will still retain the separation of the modules themselves - the new test module might just be very large.

aljo242 avatar Jul 27 '22 12:07 aljo242

We will still retain the separation of the modules themselves - the new test module might just be very large.

I don't get that point. How this would retain the separation of the modules ?

tbruyelle avatar Jul 27 '22 13:07 tbruyelle

We will still retain the separation of the modules themselves - the new test module might just be very large.

I don't get that point. How this would retain the separation of the modules ?

I just mean that if we include tests in a separate packages ("pkg_test") we can still separate the logic of the modules themselves. This _test package can just import them.

Maybe I'm misunderstanding something though lol

aljo242 avatar Jul 28 '22 14:07 aljo242

This makes a lot of sense!

It fell into oblivion because we usually let the CI run integration tests since they are way slow to run a user machine -can drive one crazy Haha

ilgooz avatar Jul 28 '22 18:07 ilgooz

I finally changed my mind, I was focused on cleaning the compiled binary at the end of tests, but as I said it requires to centralize all the integration tests in the same package. This can be annoying because those tests are long to run and it's actually nice to run a subset of tests by passing a specific sub-package to the go test command.

So the binary will be always located at /tmp/ignite-tests/ignite, and we don't clean it. I think that's acceptable.

tbruyelle avatar Aug 29 '22 16:08 tbruyelle

conflicts

aljo242 avatar Oct 03 '22 12:10 aljo242

conflicts

@aljo242 fixed thx!

tbruyelle avatar Oct 03 '22 15:10 tbruyelle