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

Platform-Specific Path Assertion Error: Windows vs. Unix Root Path Mismatch in Tests #2490

Open
Annosha opened this issue Oct 17, 2024 · 0 comments
Labels
bug Something isn't working internal pkg:instrumentation-cucumber pkg:instrumentation-fs priority:p4 Bugs and spec inconsistencies which do not fall into a higher prioritization

Comments

@Annosha
Copy link

Annosha commented Oct 17, 2024

What version of OpenTelemetry are you using?

"name": "opentelemetry-contrib",
"version": "0.1.0",
OS: Windows

What version of Node are you using?

v20.11.1

What did you do?

Cloned the repo to setup dev env for contribution
compiled the code without any warnings or errors.
compile

But running npm test on root level as well as on module level of mentioned modules give errors:
failed-test
Detailed log of errors for respective modules is attached below.
instrumentation-cucumber-test-log.txt
instrumentation-fs-test-log.txt

What did you expect to see?

The tests must be modified to handle platform-specific tests

What did you see instead?

Error due to platform-specific path mismatch. The test expects the root path 'C:\' on Windows to be loosely equal to '/', the root path on Unix-based systems. This causes an AssertionError as the file system paths differ between operating systems.
cucumber-test-error
fs-failed-test

Additional context

The test does not account for Windows-specific path formats, leading to the failure. We can:

  • Check the OS type using process.platform and adjusting the expected value accordingly.

  • Normalizing the paths to make them comparable across platforms.

@Annosha Annosha added the bug Something isn't working label Oct 17, 2024
@pichlermarc pichlermarc added internal priority:p4 Bugs and spec inconsistencies which do not fall into a higher prioritization pkg:instrumentation-fs pkg:instrumentation-cucumber labels Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working internal pkg:instrumentation-cucumber pkg:instrumentation-fs priority:p4 Bugs and spec inconsistencies which do not fall into a higher prioritization
Projects
None yet
Development

No branches or pull requests

2 participants