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

tests: fix testing on mac #1883

Closed
wants to merge 1 commit into from
Closed

tests: fix testing on mac #1883

wants to merge 1 commit into from

Conversation

cdrage
Copy link
Member

@cdrage cdrage commented May 29, 2024

tests: fix testing on mac

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

These tests do not work on mac:

▶ go test ./...
?       github.com/kubernetes/kompose   [no test files]
ok      github.com/kubernetes/kompose/client    (cached)
?       github.com/kubernetes/kompose/cmd       [no test files]
?       github.com/kubernetes/kompose/pkg/app   [no test files]
?       github.com/kubernetes/kompose/pkg/kobject       [no test files]
?       github.com/kubernetes/kompose/pkg/loader        [no test files]
?       github.com/kubernetes/kompose/pkg/testutils     [no test files]
ok      github.com/kubernetes/kompose/pkg/loader/compose        (cached)
ok      github.com/kubernetes/kompose/pkg/transformer   (cached)
?       github.com/kubernetes/kompose/pkg/utils/archive [no test files]
?       github.com/kubernetes/kompose/pkg/version       [no test files]
...
--- FAIL: Test_isConfigFile (0.00s)
    --- FAIL: Test_isConfigFile/dir_sys (0.00s)
        k8sutils_test.go:2398: isConfigFile() gotSkip = false, want true
    --- FAIL: Test_isConfigFile/dir_root (0.00s)
        k8sutils_test.go:2398: isConfigFile() gotSkip = false, want true
    --- FAIL: Test_isConfigFile/docker_var_lib (0.00s)
        k8sutils_test.go:2398: isConfigFile() gotSkip = false, want true
--- FAIL: Test_searchNetworkModeToService (0.00s)
    --- FAIL: Test_searchNetworkModeToService/search_network_mode_to_service_with_multiple_source_deployments (0.00s)
        k8sutils_test.go:2888: searchNetworkModeToService() = [{db2 app} {db1 app}], want [{db1 app} {db2 app}]
FAIL
FAIL    github.com/kubernetes/kompose/pkg/transformer/kubernetes        0.445s
ok      github.com/kubernetes/kompose/pkg/transformer/openshift (cached)
ok      github.com/kubernetes/kompose/pkg/utils/docker  (cached)
ok      github.com/kubernetes/kompose/script/test/cmd   (cached)
FAIL

I believe the others parts of the test are sufficient enough to be good
coverage. I think we can move this safely.

Which issue(s) this PR fixes:

Fixes running tests on mac since you cannot access the /sys directory,
etc.

Special notes for your reviewer:

N/A

Signed-off-by: Charlie Drage [email protected]

#### What type of PR is this?

<!--
Add one of the following kinds:
/kind bug
/kind documentation
/kind feature
-->
/kind cleanup

#### What this PR does / why we need it:

These tests do not work on mac:

```
▶ go test ./...
?       github.com/kubernetes/kompose   [no test files]
ok      github.com/kubernetes/kompose/client    (cached)
?       github.com/kubernetes/kompose/cmd       [no test files]
?       github.com/kubernetes/kompose/pkg/app   [no test files]
?       github.com/kubernetes/kompose/pkg/kobject       [no test files]
?       github.com/kubernetes/kompose/pkg/loader        [no test files]
?       github.com/kubernetes/kompose/pkg/testutils     [no test files]
ok      github.com/kubernetes/kompose/pkg/loader/compose        (cached)
ok      github.com/kubernetes/kompose/pkg/transformer   (cached)
?       github.com/kubernetes/kompose/pkg/utils/archive [no test files]
?       github.com/kubernetes/kompose/pkg/version       [no test files]
...
--- FAIL: Test_isConfigFile (0.00s)
    --- FAIL: Test_isConfigFile/dir_sys (0.00s)
        k8sutils_test.go:2398: isConfigFile() gotSkip = false, want true
    --- FAIL: Test_isConfigFile/dir_root (0.00s)
        k8sutils_test.go:2398: isConfigFile() gotSkip = false, want true
    --- FAIL: Test_isConfigFile/docker_var_lib (0.00s)
        k8sutils_test.go:2398: isConfigFile() gotSkip = false, want true
--- FAIL: Test_searchNetworkModeToService (0.00s)
    --- FAIL: Test_searchNetworkModeToService/search_network_mode_to_service_with_multiple_source_deployments (0.00s)
        k8sutils_test.go:2888: searchNetworkModeToService() = [{db2 app} {db1 app}], want [{db1 app} {db2 app}]
FAIL
FAIL    github.com/kubernetes/kompose/pkg/transformer/kubernetes        0.445s
ok      github.com/kubernetes/kompose/pkg/transformer/openshift (cached)
ok      github.com/kubernetes/kompose/pkg/utils/docker  (cached)
ok      github.com/kubernetes/kompose/script/test/cmd   (cached)
FAIL
```

I believe the others parts of the test are sufficient enough to be good
coverage. I think we can move this safely.

#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes running tests on mac since you cannot access the /sys directory,
etc.

#### Special notes for your reviewer:

N/A

Signed-off-by: Charlie Drage <[email protected]>
@k8s-ci-robot k8s-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label May 29, 2024
@k8s-ci-robot k8s-ci-robot requested a review from kadel May 29, 2024 21:43
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cdrage

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested a review from TessaIO May 29, 2024 21:43
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 29, 2024
@cdrage cdrage closed this May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants