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_dump_rule_file depends on OS filename sorting #3581

Closed
licquia opened this issue Nov 13, 2023 · 3 comments · Fixed by #3582
Closed

test_dump_rule_file depends on OS filename sorting #3581

licquia opened this issue Nov 13, 2023 · 3 comments · Fixed by #3582
Labels

Comments

@licquia
Copy link
Contributor

licquia commented Nov 13, 2023

Description

The test TestRule.test_dump_rule_file in tests/licensedcode/test_models.py appears to rely on the native OS to sort directory listings when finding rule files to compare. On my system (Debian 12), this results in the test attempting to compare a rule file for GPL 2.0 to a rule file for the LZMA license, which obviously fails. Sorting the results of models.load_rules() for each fixes the problem.

How To Reproduce

git checkout develop
./configure --dev
venv/bin/py.test -n6

System configuration

  • What OS are you running on? (Windows/MacOS/Linux)
    ** Linux, specifically Debian 12
  • What version of scancode-toolkit was used to generate the scan file?
    ** The develop branch (specifically, commit 1c4d6be)
  • What installation method was used to install/run scancode? (pip/source download/other)
    ** Checkout from GitHub
@licquia licquia added the bug label Nov 13, 2023
licquia pushed a commit to licquia/scancode-toolkit that referenced this issue Nov 13, 2023
@pombredanne
Copy link
Member

Thanks! I wonder if there is something special with Debian 12 and the file system encoding? @AyanSinhaMahapatra we likely want to add Debian 12 as a CI target.

@licquia
Copy link
Contributor Author

licquia commented Nov 13, 2023

I'm not sure; my guess was that it was simply unsorted by default, since the results from the debugger showed the files being reported in what seemed like a random order. For what it's worth, it's a brand-new install (never upgraded from a previous version of Debian), and here are the mount flags pasted from sudo mount for the root FS and /tmp:

    /dev/nvme0n1p2 on / type ext4 (rw,noatime,discard)
    tmpfs on /tmp type tmpfs (rw,noatime,inode64)

AyanSinhaMahapatra pushed a commit that referenced this issue Nov 15, 2023
Fixes #3581.

Signed-off-by: Jeff Licquia <[email protected]>
Co-authored-by: Jeff Licquia <[email protected]>
@AyanSinhaMahapatra
Copy link
Member

@pombredanne yes, we have #2731 open to also have debian in CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants