Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

tests: fix execution on WSL2, Ubuntu 24.04#8235

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
martinkunkel2 wants to merge2 commits intouutils:main
base:main
Choose a base branch
Loading
frommartinkunkel2:wsl2_test_compatibility

Conversation

martinkunkel2
Copy link
Contributor

I tried to run

cargo nextest run --features unix

in WSL2, which results in a few failing tests

     Summary [  53.695s] 3949 tests run: 3939 passed, 10 failed, 46 skipped        FAIL [   0.029s] coreutils::tests test_cp::test_cp_debug_default_sparse_virtual_file        FAIL [   0.045s] coreutils::tests test_cp::test_cp_debug_sparse_always_sparse_virtual_file        FAIL [   0.057s] coreutils::tests test_cp::test_cp_default_virtual_file        FAIL [   0.356s] coreutils::tests test_date::test_date_tz        FAIL [   0.155s] coreutils::tests test_date::test_date_tz_various_formats        FAIL [   0.043s] coreutils::tests test_head::test_read_backwards_bytes_proc_fs_modules        FAIL [   0.024s] coreutils::tests test_head::test_read_backwards_bytes_sys_kernel_profiling        FAIL [   0.042s] coreutils::tests test_head::test_read_backwards_lines_proc_fs_modules        FAIL [   0.041s] coreutils::tests test_logname::test_normal        FAIL [   0.022s] coreutils::tests test_wc::test_files_from_pseudo_filesystem

This pull request skips incompatible parts of tests to ensure that they execute successfully in WSL2, Ubuntu 24.04 distribution.

Changes

  • Skip tests that required sys/kernel/profiling which is not available in WSL2 default configuration.
  • Use timezones in tests that are part of the standard tzdata list and not only available in backwards list. Backwards list is not installed by default in Ubuntu 24.04 (package tzdata-legacy).
  • check that /proc/modules is not empty when expecting content, because it is empty in WSL2 default configuration.
  • Skip logname test not only in WSL1, also in WSL2.

Test environment:

$ cat /proc/sys/kernel/osrelease 5.15.167.4-microsoft-standard-WSL2$ cat /etc/os-release PRETTY_NAME="Ubuntu 24.04.2 LTS"NAME="Ubuntu"VERSION_ID="24.04"VERSION="24.04.2 LTS (Noble Numbat)"VERSION_CODENAME=noble

@github-actionsGitHub Actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

@sylvestre
Copy link
Contributor

Would it be possible to add a job in github to verify that we don't regress?

@martinkunkel2
Copy link
ContributorAuthor

Would it be possible to add a job in github to verify that we don't regress?

Never tried to run WSL2 in github actions, but I will try.

I see that there exists actionhttps://github.com/vedantmgoyal9/setup-wsl2 to setup WSL2 on windows runners.
Am I allowed to use this setup-wsl2 action?

If yes, I would create a new workflow file, a bit similar to freebsd or android and execute the tests based on the setup-wsl2 action.

@martinkunkel2
Copy link
ContributorAuthor

will also checkhttps://github.com/marketplace/actions/setup-wsl. This supports setting user instead of root, which should make this even more compatible with local exection.

@sylvestre
Copy link
Contributor

yeah, no worries for the action

@martinkunkel2
Copy link
ContributorAuthor

@sylvestre : I added a new workflow for WSL2.
It usesVampire/setup-wsl to install WSL2 on windows-latest runners.

Here is a test execution:https://github.com/martinkunkel2/coreutils/actions/runs/15799503167/job/44535926995

@github-actionsGitHub Actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

@martinkunkel2
Copy link
ContributorAuthor

@sylvestre : this is ready from my side. Please provide feedback if the new workflow should be added or not.

@github-actionsGitHub Actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

Skip incompatible parts of tests to ensure that    cargo nextest run --features unixexecutes successfully in WSL2, Ubuntu 24.04 distribution.Changes* Skip tests that required sys/kernel/profiling which is notavailable in WSL2 default configuration.* Use timezones in tests that are part of the standard tzdatalist and not only available in backwards list. Backwards list isnot installed by default in Ubuntu 24.04 (package tzdata-legacy).* check that /proc/modules is not empty when expecting content,because it is empty in WSL2 default configuration.* Skip logname test not only in WSL1, also in WSL2.
This will setup WSL2 on windows-latest runner, installUbuntu-24.04, and run the feat_os_unix tests.
@github-actionsGitHub Actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@martinkunkel2@sylvestre

[8]ページ先頭

©2009-2025 Movatter.jp