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

Fix test get logs template uri test #4760

Merged
merged 2 commits into from
Jan 23, 2024

Conversation

eapolinario
Copy link
Contributor

@eapolinario eapolinario commented Jan 22, 2024

Tracking issue

NA

Why are the changes needed?

TestGetLogsTemplateUri would fail with error:

    common_operator_test.go:216:
                Error Trace:    /Users/eduardo/repos/flyte-copy/flyteplugins/go/tasks/plugins/k8s/kfoperators/common/common_operator_test.go:216
                Error:          Not equal:
                                expected: "https://console.cloud.google.com/logs/query;query=resource.labels.pod_name=test-worker-0&timestamp>2022-01-01T12:00:00Z"
                                actual  : "https://console.cloud.google.com/logs/query;query=resource.labels.pod_name=test-worker-0&timestamp>2022-01-01T04:00:00-08:00"

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1 +1 @@
                                -https://console.cloud.google.com/logs/query;query=resource.labels.pod_name=test-worker-0&timestamp>2022-01-01T12:00:00Z
                                +https://console.cloud.google.com/logs/query;query=resource.labels.pod_name=test-worker-0&timestamp>2022-01-01T04:00:00-08:00
                Test:           TestGetLogsTemplateUri

The reason being the discrepancy between local and CI environments, in the former (e.g. Macos) the local timezone would be set, whereas in CI (i.e. linux) the local timezone would be unset, which would default to UTC. This discrepancy would cause this test to always fail when run locally.

What changes were proposed in this pull request?

Force the tests in this test suite to run on UTC using TestMain.

How was this patch tested?

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Signed-off-by: Eduardo Apolinario <[email protected]>
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Jan 22, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 22, 2024
@eapolinario eapolinario merged commit 41d6173 into master Jan 23, 2024
43 checks passed
@eapolinario eapolinario deleted the fix-TestGetLogsTemplateUri-test branch January 23, 2024 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants