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

fix(test): JSON-LD Unit tests fail on Windows #3670

Merged

Conversation

rohrbachd
Copy link
Contributor

What this PR changes/adds

Fixes issue JSON-LD Unit tests fail on Windows #3408

The URI is asserted against the value: "file:/tmp/foo/doc.json" but on Windows the value will include the drive name such as: "file:/C:/tmp/foo/doc.json".

Implemented suggested fix to replace:
assertThat(cache).containsEntry("http://foo.org/doc.json", new URI("file:/tmp/foo/doc.json"));

With:
assertThat(cache).containsEntry("http://foo.org/doc.json", new File("/tmp/foo/doc.json").toURI());

Why it does that

If not fixed the bug prevents building connector with extensions on Windows systems.

Linked Issue(s)

Closes #3408

rohrbachd and others added 2 commits November 29, 2023 09:33
Fixes comparison of cached file names on Windows machines as described by Barium. In the unit tests for JsonLdExtension the URI is asserted against the value: "file:/tmp/foo/doc.json" but on Windows the value will include the drive name such as: "file:/C:/tmp/foo/doc.json".

The suggested solution of replacing for example
assertThat(cache).containsEntry("http://foo.org/doc.json", new URI("file:/tmp/foo/doc.json"));

with
assertThat(cache).containsEntry("http://foo.org/doc.json", new File("/tmp/foo/doc.json").toURI());

was implmeented and verified on windows machine
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

We are always happy to welcome new contributors ❤️ To make things easier for everyone, please make sure to follow our contribution guidelines, check if you have already signed the ECA, and relate this pull request to an existing issue or discussion.

@rohrbachd rohrbachd changed the title fix(test): JSON-LD Unit tests fail on Windows #3408. fix(test): JSON-LD Unit tests fail on Windows Nov 29, 2023
Copy link
Member

@ndr-brt ndr-brt left a comment

Choose a reason for hiding this comment

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

thanks

@ndr-brt ndr-brt added the build Anything related to the CI/CD Pipeline on Github Actions label Nov 30, 2023
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cd9dbec) 71.68% compared to head (79a4dc7) 71.68%.
Report is 2 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3670   +/-   ##
=======================================
  Coverage   71.68%   71.68%           
=======================================
  Files         916      916           
  Lines       18416    18416           
  Branches     1043     1043           
=======================================
  Hits        13201    13201           
  Misses       4757     4757           
  Partials      458      458           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ndr-brt ndr-brt merged commit ffd513f into eclipse-edc:main Nov 30, 2023
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Anything related to the CI/CD Pipeline on Github Actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON-LD Unit tests fail on Windows
3 participants