quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.28k stars 2.54k forks source link

Fix pathname encoding in the component test library #40640

Closed FWest98 closed 4 weeks ago

FWest98 commented 1 month ago

The component test library did not properly decode the URI file path, causing characters like spaces in the path to break tests. For example, in the old setup:

String testPath = testClass.getClassLoader().getResource(testClassResourceName).getFile();
// returns "/foo/foo%20bar/org/acme/Foo.class"

String testClassesRootPath = ...
// yields "/foo/foo%20bar"

testOutputDirectory = new File(testClassesRootPath);
// file not found, tests break
geoand commented 4 weeks ago

Any chance you could add a test for this?

FWest98 commented 4 weeks ago

I was looking into that, but I think the only way to do so is to create a new subproject somewhere with a special character in its name, and then add a test there. I was not quite sure whether that's desired, and if so, how to proceed with that.

In case the extra subproject is still desired for this, could you give me some directions on how to approach it?

quarkus-bot[bot] commented 4 weeks ago

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 9c71d7a4b213ed430bbb0aab8d05b82774eaf75a.

:white_check_mark: The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.