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

test: skip non-applicable unit tests on Windows #651

Merged
merged 2 commits into from
Apr 27, 2023

Conversation

JeyJeyGao
Copy link
Contributor

@JeyJeyGao JeyJeyGao commented Apr 26, 2023

Fix unit test:

  • skip some unit test cases because Windows handles file permissions differently from Unix-based systems, and therefore, using file permissions like 0000, 0600, 0644, or 0700 in tests may not work as expected on Windows.

Test:

  • unit test on Windows
  • unit test on Linux

Test output:

?       github.com/notaryproject/notation/cmd/notation/internal/cmdutil [no test files]
?       github.com/notaryproject/notation/cmd/notation/internal/errors  [no test files]
?       github.com/notaryproject/notation/internal/cmd  [no test files]
?       github.com/notaryproject/notation/cmd/notation/policy   [no test files]
?       github.com/notaryproject/notation/internal/experimental [no test files]
?       github.com/notaryproject/notation/internal/ioutil       [no test files]
ok      github.com/notaryproject/notation/cmd/notation  (cached)
ok      github.com/notaryproject/notation/cmd/notation/cert     (cached)
ok      github.com/notaryproject/notation/cmd/notation/internal/truststore      (cached)
ok      github.com/notaryproject/notation/internal/envelope     (cached)
ok      github.com/notaryproject/notation/internal/osutil       (cached)
ok      github.com/notaryproject/notation/internal/slices       (cached)
ok      github.com/notaryproject/notation/internal/trace        (cached)
ok      github.com/notaryproject/notation/internal/tree (cached)
ok      github.com/notaryproject/notation/internal/version      (cached)
ok      github.com/notaryproject/notation/pkg/auth      (cached)
ok      github.com/notaryproject/notation/pkg/configutil        (cached)

Signed-off-by: Junjie Gao [email protected]

@codecov-commenter
Copy link

codecov-commenter commented Apr 26, 2023

Codecov Report

Merging #651 (b8a6830) into main (2e56dd4) will not change coverage.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##             main     #651   +/-   ##
=======================================
  Coverage   33.16%   33.16%           
=======================================
  Files          32       32           
  Lines        2014     2014           
=======================================
  Hits          668      668           
  Misses       1324     1324           
  Partials       22       22           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Signed-off-by: Junjie Gao <[email protected]>
@JeyJeyGao JeyJeyGao changed the title fix: unit test on Windows test: unit test on Windows Apr 26, 2023
Copy link
Contributor

@patrickzheng200 patrickzheng200 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR title should be test: skip non-applicable unit tests on Windows.

internal/osutil/file_test.go Outdated Show resolved Hide resolved
@JeyJeyGao JeyJeyGao changed the title test: unit test on Windows test: skip non-applicable unit tests on Windows Apr 27, 2023
Signed-off-by: Junjie Gao <[email protected]>
Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@patrickzheng200 patrickzheng200 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@priteshbandi priteshbandi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

None yet

5 participants