Skip to content

tests: replace %PWD with %FILE_PWD for file:// - #15090

Closed
vszakats wants to merge 13 commits into
curl:masterfrom
vszakats:tests-file-pwd
Closed

tests: replace %PWD with %FILE_PWD for file://#15090
vszakats wants to merge 13 commits into
curl:masterfrom
vszakats:tests-file-pwd

Conversation

@vszakats

@vszakats vszakats commented Sep 30, 2024

Copy link
Copy Markdown
Member

Before this patch not all tests used %FILE_PWD with the file://
protocol.

Keep %PWD for test1145, to keep it fail on Windows like the test
expects.

Cherry-picked from #14949


Except for test1145, where FILE_PWD breaks it for Win32. I'm unsure if
this is a problem with the test, with the code or with the expected
result on native Windows.

Before/after this PR on Windows:

../src/curl.exe [...] file://bad-hostD:/a/curl/curl/bld/tests//log/7/test1145.txt

https://github.com/curl/curl/actions/runs/11086916586/job/30805027531#step:25:9297

When replacing %PWD with %FILE_PWD the URL becomes correct, but
the failure isn't the one expected by the test:

../src/curl.exe [...] file://bad-host/D:/a/curl/curl/bld/tests/log/7/test1145.txt

Fails due to:

curl returned 37, when expecting 3
curl: (37) Couldn't open file //bad-host/D:/a/curl/curl/bld/tests/log/7/test1145.txt

https://github.com/curl/curl/actions/runs/11092904035/job/30818523915#step:25:9854

I'm guessing this is a problem with the test, because on native Windows
that sort of URL isn't a malformed one, just a normal one that's not
hitting any file. To trigger a malformed one, besides bad-host it also
needs a bad %PWD, which was done by accident before this patch.

…rong for Win32?

Before this PR on Windows:
runclient: msys: Executing: '../src/curl.exe -q --output log/7/curl1145.out  --include --trace-ascii log/7/trace1145 --trace-config all --trace-time file://bad-hostD:/a/curl/curl/bld/tests//log/7/test1145.txt > log/7/stdout1145 2> log/7/stderr1145'
https://github.com/curl/curl/actions/runs/11086916586/job/30805027531#step:25:9297

This PR before this patch after switch PWD to FILE_PWD:
runclient: msys: Executing: '../src/curl.exe -q --output log/7/curl1145.out  --include --trace-ascii log/7/trace1145 --trace-config all --trace-time file://bad-host/D:/a/curl/curl/bld/tests/log/7/test1145.txt > log/7/stdout1145 2> log/7/stderr1145'
Fails due to:
curl returned 37, when expecting 3
curl: (37) Couldn't open file //bad-host/D:/a/curl/curl/bld/tests/log/7/test1145.txt
https://github.com/curl/curl/actions/runs/11092904035/job/30818523915#step:25:9854

I'm not sure where the bug is in this case.
@vszakats vszakats added the tests label Sep 30, 2024
@vszakats vszakats changed the title tests: replace PWD with FILE_PWD, fix it for native Win32 Perl tests: replace PWD with FILE_PWD for file:// Sep 30, 2024
@vszakats vszakats added the Windows Windows-specific label Sep 30, 2024
@vszakats
vszakats marked this pull request as draft September 30, 2024 14:23
@vszakats vszakats added tidy-up and removed Windows Windows-specific labels Sep 30, 2024
@vszakats vszakats changed the title tests: replace PWD with FILE_PWD for file:// tests: replace %PWD with %FILE_PWD for file:// Sep 30, 2024
@vszakats
vszakats marked this pull request as ready for review September 30, 2024 18:51
@vszakats vszakats closed this in f6cb707 Sep 30, 2024
@vszakats
vszakats deleted the tests-file-pwd branch September 30, 2024 21:48
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
Before this patch not all tests used `%FILE_PWD` with the `file://`
protocol.

Keep `%PWD` for test1145, to keep it fail on Windows like the test
expects.

Cherry-picked from curl#14949

Closes curl#15090
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant