Skip to content

dev: make test target fails with overriden k8gb env vars #835

Closed
@somaritane

Description

make test (unit test) build target fails when k8gb env vars are set in the shell
or .env file before running the target:

❯ EDGE_DNS_SERVER=8.8.8.8 make test
...
                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -14,3 +14,3 @@
                                  },
                                - fallbackEdgeDNSServerName: (string) "",
                                + fallbackEdgeDNSServerName: (string) (len=7) "8.8.8.8",
                                  fallbackEdgeDNSServerPort: (int) 53,
                Test:           TestResolveConfigWithNegativeReconcileRequeueSecondsKey
...
❯ touch .env; make test
...
                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -14,3 +14,3 @@
                                  },
                                - fallbackEdgeDNSServerName: (string) "",
                                + fallbackEdgeDNSServerName: (string) (len=7) "1.1.1.1",
                                  fallbackEdgeDNSServerPort: (int) 53,
                Test:           TestResolveConfigWithNegativeReconcileRequeueSecondsKey
...
echo "EDGE_DNS_SERVER=8.8.8.8" > .env; make test
...
                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -14,3 +14,3 @@
                                  },
                                - fallbackEdgeDNSServerName: (string) "",
                                + fallbackEdgeDNSServerName: (string) (len=7) "8.8.8.8",
                                  fallbackEdgeDNSServerPort: (int) 53,
                Test:           TestResolveConfigWithZeroReconcileRequeueSecondsKey
...

IMHO unit testing environment should be isolated and not dependant on externally set variables.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    CIall the things related to gh actions or workflowbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions