Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

controllers: Fix helmchart values file merge test #494

Merged
merged 1 commit into from
Nov 22, 2021

Conversation

darkowlzz
Copy link
Contributor

Test case "Setting valid valuesFile attribute" and the tests around it
aren't isolated and most of the time pass because of the results from
the previous tests being re-read as the test expectation match the
previous test results. Failures are very rare to reproduce, even in
the CI they aren't seen but it failed very frequently on my computer,
especially this specific case because unlike the other cases, there is
just one file to be merged, which invalidates the chart result from
the previous cases.
In order to ensure the test wait for the chart to be updated by its
action and not by any other previous updates, status condition message
seems to be the most reliable way, as it also contains the paths of the
files that were merged.
With this change, I could no longer reproduce the failure on my
computer.
Reordering the tests makes this issue more clear.

• Failure [17.115 seconds]
HelmChartReconciler
~/go/src/github.com/fluxcd/source-controller/controllers/helmchart_controller_test.go:52
  HelmChart from GitRepository
  ~/go/src/github.com/fluxcd/source-controller/controllers/helmchart_controller_test.go:554
    Creates artifacts for [It]
    ~/go/src/github.com/fluxcd/source-controller/controllers/helmchart_controller_test.go:582

    Expected
        <bool>: true
    to be false

    ~/go/src/github.com/fluxcd/source-controller/controllers/helmchart_controller_test.go:840

Since the reconcilers-dev branch has all the new tests with new
structures, I'm not sure if we need to make these tests any better.
They do validate the results, but fail sometimes on some machines.

Same as #492, couldn't reopen that again.

Test case "Setting valid valuesFile attribute" and the tests around it
aren't isolated and most of the time pass because of the results from
the previous tests being re-read as the test expectation match the
previous test results. Failures are very rare to reproduce, even in
the CI they aren't seen but it failed very frequently on my computer,
especially this specific case because unlike the other cases, there is
just one file to be merged, which invalidates the chart result from
the previous cases.
In order to ensure the test wait for the chart to be updated by its
action and not by any other previous updates, status condition message
seems to be the most reliable way, as it also contains the paths of the
files that were merged.
With this change, I could no longer reproduce the failure on my
computer.
Reordering the tests makes this issue more clear.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
@hiddeco hiddeco merged commit d776221 into fluxcd:main Nov 22, 2021
@darkowlzz darkowlzz deleted the helmchart-e2e-test-val-merge branch November 22, 2021 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants