mirror of https://github.com/fluxcd/flux2.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
The TestTrace/Deployment and TestTrace/HelmRelease test cases fail in
environments where the timezone isn't UTC, because they compare a local time
string to the golden file, which has time in UTC. Here is an example:
```
--- FAIL: TestTrace (0.12s)
--- FAIL: TestTrace/Deployment (0.08s)
main_test.go:337: Mismatch from golden file 'testdata/trace/deployment.golden': Mismatch from expected value (-want +got):
strings.Join({
... // 88 identical bytes
" Flux\n---\nHelmRelease: podinfo\nNamespace: podinfo-8\nRevi",
"sion: 6.0.0\nStatus: Last reconciled at 2021-07-16 ",
- "15:42:20 +0000 UTC",
+ "09:42:20 -0600 MDT",
"\nMessage: Release reconciliation succeeded\n---\nHelmChart:",
" podinfo-podinfo\nNamespace: flux-system-9\nChart: ",
" podinfo\nVersion: 6.0.0\nRevision: 6.0.0\nStatus: ",
" Last reconciled at 2021-07-16 ",
- "15:32:09 +0000 UTC",
+ "09:32:09 -0600 MDT",
"\nMessage: Fetched revision: 6.0.0\n---\nHelmRepository: pod",
"info\nNamespace: flux-system-9\nURL: https://stefa",
"nprodan.github.io/podinfo\nRevision: 8411f23d07d3701f0e96e7",
"d9e503b7936d7e1d56\nStatus: Last reconciled at 2021-07-",
- "1",
"1",
- " 00:25:46 +0000 UTC",
+ "0 18:25:46 -0600 MDT",
"\nMessage: Fetched revision: 8411f23d07d3701f0e96e7d9e503b",
"7936d7e1d56\n",
}, "")
```
This commit fixes the issue by converting the golden test times to local
time before comparing. The utility function toLocalTime() is added to
trace_test.go, and then it is used to provide localized times as
template parameters to the golden files.
Signed-off-by: Andrew Jenkins <andrew@aspenmesh.io>
|
4 years ago | |
|---|---|---|
| .. | ||
| testdata | 4 years ago | |
| alert.go | 4 years ago | |
| alert_provider.go | 4 years ago | |
| bootstrap.go | 4 years ago | |
| bootstrap_bitbucket_server.go | 4 years ago | |
| bootstrap_git.go | 4 years ago | |
| bootstrap_github.go | 4 years ago | |
| bootstrap_gitlab.go | 4 years ago | |
| build.go | 4 years ago | |
| build_kustomization.go | 4 years ago | |
| build_kustomization_test.go | 4 years ago | |
| check.go | 4 years ago | |
| check_test.go | 4 years ago | |
| completion.go | 4 years ago | |
| completion_bash.go | 5 years ago | |
| completion_fish.go | 5 years ago | |
| completion_powershell.go | 5 years ago | |
| completion_zsh.go | 4 years ago | |
| create.go | 4 years ago | |
| create_alert.go | 4 years ago | |
| create_alertprovider.go | 4 years ago | |
| create_helmrelease.go | 4 years ago | |
| create_image.go | 5 years ago | |
| create_image_policy.go | 4 years ago | |
| create_image_repository.go | 4 years ago | |
| create_image_update.go | 4 years ago | |
| create_kustomization.go | 4 years ago | |
| create_receiver.go | 4 years ago | |
| create_secret.go | 5 years ago | |
| create_secret_git.go | 4 years ago | |
| create_secret_git_test.go | 4 years ago | |
| create_secret_helm.go | 4 years ago | |
| create_secret_helm_test.go | 4 years ago | |
| create_secret_tls.go | 4 years ago | |
| create_secret_tls_test.go | 4 years ago | |
| create_source.go | 4 years ago | |
| create_source_bucket.go | 4 years ago | |
| create_source_git.go | 4 years ago | |
| create_source_git_test.go | 4 years ago | |
| create_source_helm.go | 4 years ago | |
| create_tenant.go | 4 years ago | |
| create_test.go | 4 years ago | |
| delete.go | 4 years ago | |
| delete_alert.go | 4 years ago | |
| delete_alertprovider.go | 4 years ago | |
| delete_helmrelease.go | 4 years ago | |
| delete_image.go | 5 years ago | |
| delete_image_policy.go | 4 years ago | |
| delete_image_repository.go | 4 years ago | |
| delete_image_update.go | 4 years ago | |
| delete_kustomization.go | 4 years ago | |
| delete_receiver.go | 4 years ago | |
| delete_source.go | 5 years ago | |
| delete_source_bucket.go | 4 years ago | |
| delete_source_git.go | 4 years ago | |
| delete_source_helm.go | 4 years ago | |
| diff.go | 4 years ago | |
| diff_kustomization.go | 4 years ago | |
| diff_kustomization_test.go | 4 years ago | |
| docgen.go | 5 years ago | |
| export.go | 4 years ago | |
| export_alert.go | 4 years ago | |
| export_alertprovider.go | 4 years ago | |
| export_helmrelease.go | 4 years ago | |
| export_image.go | 5 years ago | |
| export_image_policy.go | 4 years ago | |
| export_image_repository.go | 4 years ago | |
| export_image_update.go | 4 years ago | |
| export_kustomization.go | 4 years ago | |
| export_receiver.go | 4 years ago | |
| export_secret.go | 4 years ago | |
| export_source.go | 5 years ago | |
| export_source_bucket.go | 4 years ago | |
| export_source_git.go | 4 years ago | |
| export_source_helm.go | 4 years ago | |
| export_test.go | 4 years ago | |
| get.go | 4 years ago | |
| get_alert.go | 4 years ago | |
| get_alertprovider.go | 4 years ago | |
| get_all.go | 4 years ago | |
| get_helmrelease.go | 4 years ago | |
| get_image.go | 4 years ago | |
| get_image_all.go | 4 years ago | |
| get_image_policy.go | 4 years ago | |
| get_image_repository.go | 4 years ago | |
| get_image_update.go | 4 years ago | |
| get_kustomization.go | 4 years ago | |
| get_receiver.go | 4 years ago | |
| get_source.go | 4 years ago | |
| get_source_all.go | 4 years ago | |
| get_source_bucket.go | 4 years ago | |
| get_source_chart.go | 4 years ago | |
| get_source_git.go | 4 years ago | |
| get_source_helm.go | 4 years ago | |
| helmrelease.go | 4 years ago | |
| helmrelease_test.go | 4 years ago | |
| image.go | 4 years ago | |
| image_test.go | 4 years ago | |
| install.go | 4 years ago | |
| kustomization.go | 4 years ago | |
| kustomization_test.go | 4 years ago | |
| log.go | 5 years ago | |
| logs.go | 4 years ago | |
| logs_test.go | 4 years ago | |
| main.go | 4 years ago | |
| main_e2e_test.go | 4 years ago | |
| main_test.go | 4 years ago | |
| main_unit_test.go | 4 years ago | |
| manifests.embed.go | 4 years ago | |
| object.go | 4 years ago | |
| receiver.go | 4 years ago | |
| reconcile.go | 4 years ago | |
| reconcile_alert.go | 4 years ago | |
| reconcile_alertprovider.go | 4 years ago | |
| reconcile_helmrelease.go | 4 years ago | |
| reconcile_image.go | 5 years ago | |
| reconcile_image_repository.go | 4 years ago | |
| reconcile_image_updateauto.go | 4 years ago | |
| reconcile_kustomization.go | 4 years ago | |
| reconcile_receiver.go | 4 years ago | |
| reconcile_source.go | 5 years ago | |
| reconcile_source_bucket.go | 4 years ago | |
| reconcile_source_git.go | 4 years ago | |
| reconcile_source_helm.go | 4 years ago | |
| reconcile_with_source.go | 4 years ago | |
| resume.go | 4 years ago | |
| resume_alert.go | 4 years ago | |
| resume_helmrelease.go | 4 years ago | |
| resume_image.go | 5 years ago | |
| resume_image_repository.go | 4 years ago | |
| resume_image_updateauto.go | 4 years ago | |
| resume_kustomization.go | 4 years ago | |
| resume_receiver.go | 4 years ago | |
| resume_source.go | 5 years ago | |
| resume_source_bucket.go | 4 years ago | |
| resume_source_chart.go | 4 years ago | |
| resume_source_git.go | 4 years ago | |
| resume_source_helm.go | 4 years ago | |
| source.go | 4 years ago | |
| status.go | 4 years ago | |
| suspend.go | 4 years ago | |
| suspend_alert.go | 4 years ago | |
| suspend_helmrelease.go | 4 years ago | |
| suspend_image.go | 5 years ago | |
| suspend_image_repository.go | 4 years ago | |
| suspend_image_updateauto.go | 4 years ago | |
| suspend_kustomization.go | 4 years ago | |
| suspend_receiver.go | 4 years ago | |
| suspend_source.go | 5 years ago | |
| suspend_source_bucket.go | 4 years ago | |
| suspend_source_chart.go | 4 years ago | |
| suspend_source_git.go | 4 years ago | |
| suspend_source_helm.go | 4 years ago | |
| trace.go | 4 years ago | |
| trace_test.go | 4 years ago | |
| tree.go | 4 years ago | |
| tree_kustomization.go | 4 years ago | |
| tree_kustomization_test.go | 4 years ago | |
| uninstall.go | 4 years ago | |
| version.go | 4 years ago | |
| version_utils.go | 4 years ago | |
| version_utils_test.go | 4 years ago | |