From 416100a50cff6a7d456815fe47f82e0f28f22a2c Mon Sep 17 00:00:00 2001 From: JOASSART Edwin Date: Sat, 27 Apr 2024 09:56:22 +0200 Subject: [PATCH] patch: passing url e2e ? --- .github/actions/test/action.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index 6bd4af2fceb..ca69edd3c77 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -69,15 +69,25 @@ runs: run: | fsutil file createnew virtual_test_disk.img 4294967296 - echo SELECT VDISK FILE=virtual_test_disk.img > diskpart_script.txt - echo ATTACH VDISK >> diskpart_script.txt - echo LIST VOLUME >> diskpart_script.txt - diskpart /s diskpart_script.txt > diskpart_output.txt + # Use DiskPart to attach and list volumes + $diskpartScript = @" + SELECT VDISK FILE=virtual_test_disk.img + ATTACH VDISK + LIST VOLUME + "@ + + diskpart /s $diskpartScript | Out-File -FilePath diskpart_output.txt -Encoding UTF8 - echo LIST VOLUME > list_volumes.txt - for /f "tokens=2,3 delims= " %%a in ('find "virtual_test_disk.img" diskpart_output.txt') do ( - set drive_letter=%%a - ) + # Extract the volume information from the DiskPart output + $diskpartOutput = Get-Content -Path diskpart_output.txt + $driveLine = $diskpartOutput | Select-String -Pattern "virtual_test_disk.img" + + # Extract drive letter + $driveLetter = $null + if ($driveLine) { + $tokens = $driveLine -split "\s+" + $driveLetter = $tokens[2] + } echo "TARGET_DRIVE=!drive_letter!:\\" >> %GITHUB_ENV% @@ -98,6 +108,7 @@ runs: # tests; note that they required `package` to run before npm run wdio + # e2e suite requires administrative privileges if [[ '${{ runner.os }}' == 'Windows' ]]; then npm run wdio-e2e else