containers / podman-desktop-e2e

Podman desktop e2e tests
Apache License 2.0
3 stars 7 forks source link

Improve the secrets file handling on windows which throws some errors now #184

Closed odockal closed 3 months ago

odockal commented 3 months ago

When we are not passing a secrets file, powershell handles the code this way:

 Get-Content: C:\Users\rhqp\pd-e2e\runner.ps1:123
Line |
 123 |          $properties = Get-Content $secretFilePath | ForEach-Object {
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Unable to get content because it is a directory: 'C:\Users\rhqp\pd-e2e\'. Please use 'Get-ChildItem' instead.
----                 -------------         ------ ----

Also throws an error on the file removal (which should not happen).

Remove-Item: C:\Users\rhqp\pd-e2e\runner.ps1:342
Line |
 342 |  Remove-Item -Path "$resourcesPath/$secretFile"
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot remove the item at 'C:\Users\rhqp\pd-e2e\' because it is in use.
npm ERR!   in workspace: bootc-tests-playwright@0.0.1 
npm ERR!   at location: C:\Users\rhqp\pd-e2e\podman-desktop-extension-bootc\tests\playwright 
error Command failed with exit code 1.
odockal commented 3 months ago

Fixed by: https://github.com/odockal/pde2e-runner/commit/c3630688675a4637342e3ad7d88239d2ff0b1768

Working location:  C:\Users\rhqp\pd-e2e
Loading Variables passed into image
Input String: 'TEST_PODMAN_MACHINE=true'
Processing TEST_PODMAN_MACHINE=true
There is no file with secrets, skipping...
Installing node
v20.11.1
10.2.4
Installing yarn