Commit Graph

6 Commits (5b422bef179694900b6e5b511c0a2a4e43e427c8)

Author SHA1 Message Date
Aurel Canciu f3d143e5ee
Update Go to v1.17
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
3 years ago
Jakob Schrettenbrunner ca7d2e783f Use k8s.io/cli-runtime for kubernetes flags
Signed-off-by: Jakob Schrettenbrunner <jakob.schrettenbrunner@telekom.de>
3 years ago
Stefan Prodan 3d4ca831dc
Add missing copyright headers
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago
Allen Porter 8cbd4e8172 Add test for "flux create source git"
The create source tests are more interesting than the existing tests as they
create objects then wit for the flux source reconciler to complete. The tests
simulate this with a background goroutine that waits for an object to be
created then uses a test specific function to update it.

The tests set a timeout so that if there is a failure they timeout somewhat
quickly rather than hanging for a longer period of time.

Signed-off-by: Allen Porter <allen@thebends.org>
3 years ago
Allen Porter d45501a129 Use shared envTest for unit tests
Speed up unit tests by using a shared envTest. This requires each
test to use its own namespace to avoid clobbering objects for
other tests. Tests previously took around 8 seconds each, and now
the initial test takes 2 seconds with follow up tests taking less
than a second each.

Also update existing tests that use a fixed namespace to use a
generated namespace.

Share gold file template function with yaml files.

Remove the testClusterMode, and instead rely on MainTest to do
the appropriate test setup and rootArgs flag setup. Move the
rootArg flag setup out of NewTestEnvKubeManager to avoid
side effects.

A follow up change can be to push the individual setups
from NewTestEnvKubeManager() into their respective TestMain since
the harness share little code.

Signed-off-by: Allen Porter <allen@thebends.org>
3 years ago
Stefan Prodan d1982e64b2
Refactor e2e tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
3 years ago