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

[JUnit Platform] Support feature files with space in filename #2521

Merged
merged 2 commits into from
Apr 17, 2022
Merged

[JUnit Platform] Support feature files with space in filename #2521

merged 2 commits into from
Apr 17, 2022

Conversation

lgringo
Copy link
Contributor

@lgringo lgringo commented Apr 11, 2022

🤔 What's changed?

  • Add a file with a space in test cases.
  • Replace URI.getSchemeSpecificPart by URI.getRawSchemeSpecificPart to
    keep space encoded.

⚡️ What's your motivation?

Fixes #2520

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

…aracter Exception

* Add a file with a space in test cases.
* Replace URI.getSchemeSpecificPart by URI.getRawSchemeSpecificPart to
  keep space encoded.
@mpkorstanje
Copy link
Contributor

Looks good but could you add a test and update the changelog?

Something like this should do:

@Test
void resolveRequestWithClasspathResourceSelector() {
DiscoverySelector resource = selectClasspathResource("io/cucumber/junit/platform/engine/single.feature");
EngineDiscoveryRequest discoveryRequest = new SelectorRequest(resource);
resolver.resolveSelectors(discoveryRequest, testDescriptor);
assertEquals(1, testDescriptor.getChildren().size());
}

…aracter Exception

* Add a test
* Update test file (with space.feature) with a test (not just an empty
  feature)
* Update others tests (there is a new feature file, so other test should
  expect one file more)
* Update CHANGELOG.md
@lgringo
Copy link
Contributor Author

lgringo commented Apr 11, 2022

Hi, I had'nt add test because all the tests crashed with the new with space.feature file. This file was a feature file without scenario and as so, not detected by others tests... but it was enough to test the updated code ...

Adding a test as you asked make me add a scenario in the with space.feature and update other tests as they should expect 1 more file.

CHANGELOG.md updated

@codecov
Copy link

codecov bot commented Apr 17, 2022

Codecov Report

Merging #2521 (932a1d8) into main (5853a06) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##               main    #2521   +/-   ##
=========================================
  Coverage     83.80%   83.80%           
  Complexity     2651     2651           
=========================================
  Files           309      309           
  Lines          9360     9360           
  Branches        913      913           
=========================================
  Hits           7844     7844           
  Misses         1183     1183           
  Partials        333      333           
Impacted Files Coverage Δ
.../cucumber/junit/platform/engine/FeatureOrigin.java 97.14% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5853a06...932a1d8. Read the comment docs.

@mpkorstanje mpkorstanje changed the title Issue #2520: Feature files with space in filename generate Illegal Character Exception [JUnit Platform] Support feature files with space in filename Apr 17, 2022
@mpkorstanje mpkorstanje merged commit 25f7d56 into cucumber:main Apr 17, 2022
@aslakhellesoy
Copy link
Contributor

Hi @lgringo,

Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾

In return for this generous offer we hope you will:

  • ✅ Continue to use branches and pull requests. When someone on the core team approves a pull request (yours or someone else's), you're welcome to merge it yourself.
  • 💚 Commit to setting a good example by following and upholding our code of conduct in your interactions with other collaborators and users.
  • 💬 Join the community Slack channel to meet the rest of the team and make yourself at home.
  • ℹ️ Don't feel obliged to help, just do what you can if you have the time and the energy.
  • 🙋 Ask if you need anything. We're looking for feedback about how to make the project more welcoming, so please tell us!

On behalf of the Cucumber core team,
Aslak Hellesøy
Creator of Cucumber

@mpkorstanje
Copy link
Contributor

Cheers!

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.

Feature files with space in filename generate Illegal Character Exception (Junit5 Platform)
3 participants