test: Add tests for sub-path support
This commit is contained in:
Родитель
793cb6bd51
Коммит
e4ca666b01
|
@ -65,23 +65,43 @@ jobs:
|
|||
OverWrite: false
|
||||
flattenFolders: false
|
||||
|
||||
- bash: rm -fr ~/emsdk
|
||||
displayName: Cleanup Emscripten folder to run tests
|
||||
|
||||
## Raytracer validation
|
||||
- bash: |
|
||||
$(build.sourcesdirectory)/build/scripts/run-tests.sh \
|
||||
"$(build.sourcesdirectory)/src/Uno.Wasm.AotTests.net5/bin/Release/net5.0/dist" \
|
||||
"$(build.sourcesdirectory)/src/WasmAot.UITests"
|
||||
|
||||
"$(build.sourcesdirectory)/src/WasmAot.UITests" "http://localhost:8000/"
|
||||
displayName: Raytracer UI Tests Net5
|
||||
env:
|
||||
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)"
|
||||
|
||||
## SWA sub-path validation
|
||||
- bash: |
|
||||
cd $(build.sourcesdirectory)/src/Uno.Wasm.AotTests.net5
|
||||
dotnet msbuild /r /p:Configuration=Release /p:DISABLE_CLIHOST_NET5=true /t:Publish /m:1 "/p:WasmShellWebAppBasePath=/"
|
||||
displayName: Build RayTracer with sub-path
|
||||
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
SourceFolder: $(build.sourcesdirectory)/src/Uno.Wasm.AotTests.net5/bin/Release/net5.0/publish
|
||||
Contents: '**/*.*'
|
||||
TargetFolder: $(build.artifactstagingdirectory)/subpath-override
|
||||
CleanTargetFolder: false
|
||||
OverWrite: false
|
||||
flattenFolders: false
|
||||
|
||||
- bash: |
|
||||
$(build.sourcesdirectory)/build/scripts/run-tests-swa.sh \
|
||||
"$(build.sourcesdirectory)/src/Uno.Wasm.AotTests.net5/bin/Release/net5.0/dist" \
|
||||
"$(build.sourcesdirectory)/src/WasmAot.UITests" "http://localhost:8000/test/inner"
|
||||
displayName: Raytracer UI Tests Net5 (SWA)
|
||||
env:
|
||||
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)"
|
||||
|
||||
## Static linking validation
|
||||
- bash: |
|
||||
$(build.sourcesdirectory)/build/scripts/run-tests.sh \
|
||||
"$(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.Aot.Net5/bin/Release/net5.0/dist" \
|
||||
"$(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.Aot.UITests"
|
||||
|
||||
"$(build.sourcesdirectory)/src/Uno.Wasm.StaticLinking.Aot.UITests" "http://localhost:8000/"
|
||||
displayName: StaticLinking.Aot Tests Net5
|
||||
env:
|
||||
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)"
|
||||
|
|
|
@ -49,7 +49,8 @@ jobs:
|
|||
- pwsh: |
|
||||
$(build.sourcesdirectory)\build\scripts\run-tests-windows.ps1 `
|
||||
"$(build.sourcesdirectory)\src\Uno.Wasm.AotTests.net5\bin\Release\net5.0\dist" `
|
||||
"$(build.sourcesdirectory)\src\WasmAot.UITests"
|
||||
"$(build.sourcesdirectory)\src\WasmAot.UITests" `
|
||||
"http://localhost:8000/"
|
||||
|
||||
displayName: Raytracer UI Tests Net5
|
||||
env:
|
||||
|
@ -58,7 +59,8 @@ jobs:
|
|||
- pwsh: |
|
||||
$(build.sourcesdirectory)\build\scripts\run-tests-windows.ps1 `
|
||||
"$(build.sourcesdirectory)\src\Uno.Wasm.StaticLinking.Aot.Net5\bin\Release\net5.0\dist" `
|
||||
"$(build.sourcesdirectory)\src\Uno.Wasm.StaticLinking.Aot.UITests"
|
||||
"$(build.sourcesdirectory)\src\Uno.Wasm.StaticLinking.Aot.UITests" `
|
||||
"http://localhost:8000/"
|
||||
|
||||
displayName: StaticLinking.Aot Tests Net5
|
||||
env:
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
cleanup() {
|
||||
kill %%
|
||||
}
|
||||
trap cleanup 0
|
||||
|
||||
sudo npm install -g @azure/static-web-apps-cli
|
||||
|
||||
export BOOTSTRAP_APP_PATH=$1
|
||||
export BOOTSTRAP_TEST_RUNNER_PATH=$2
|
||||
export BOOTSTRAP_TEST_RUNNER_URL=$3
|
||||
|
||||
echo "BOOTSTRAP_APP_PATH=$BOOTSTRAP_APP_PATH"
|
||||
echo "BOOTSTRAP_TEST_RUNNER_PATH=$BOOTSTRAP_TEST_RUNNER_PATH"
|
||||
echo "BOOTSTRAP_TEST_RUNNER_URL=$BOOTSTRAP_TEST_RUNNER_URL"
|
||||
|
||||
cd $BOOTSTRAP_APP_PATH
|
||||
swa start --port 8000 --app-location "$BOOTSTRAP_APP_PATH" &
|
||||
|
||||
cd $BOOTSTRAP_TEST_RUNNER_PATH
|
||||
npm install
|
||||
node app
|
|
@ -3,6 +3,7 @@ $env:PATH="$env:PATH;$BUILD_SOURCESDIRECTORY\build\tools"
|
|||
|
||||
$BOOTSTRAP_APP_PATH=$args[0]
|
||||
$BOOTSTRAP_TEST_RUNNER_PATH=$args[1]
|
||||
$env:BOOTSTRAP_TEST_RUNNER_URL=$args[2]
|
||||
|
||||
cd $BOOTSTRAP_APP_PATH
|
||||
$serverProcess = Start-Process dotnet -ArgumentList 'serve -p 8000' -NoNewWindow -PassThru
|
||||
|
|
|
@ -6,8 +6,9 @@ cleanup() {
|
|||
}
|
||||
trap cleanup 0
|
||||
|
||||
BOOTSTRAP_APP_PATH=$1
|
||||
BOOTSTRAP_TEST_RUNNER_PATH=$2
|
||||
export BOOTSTRAP_APP_PATH=$1
|
||||
export BOOTSTRAP_TEST_RUNNER_PATH=$2
|
||||
export BOOTSTRAP_TEST_RUNNER_URL=$3
|
||||
|
||||
cd $BOOTSTRAP_APP_PATH
|
||||
python $BUILD_SOURCESDIRECTORY/build/scripts/server.py &
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"navigationFallback": {
|
||||
"rewrite": "/index.html",
|
||||
"exclude": [
|
||||
"*.{css,js}",
|
||||
"*.{png}",
|
||||
"*.{c,h,wasm,clr,pdb,dat,txt}"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1667,7 +1667,10 @@ namespace Uno.Wasm.Bootstrap
|
|||
|
||||
// Compatibility after the change from mono.js to dotnet.js
|
||||
html = html.Replace("mono.js\"", "dotnet.js\"");
|
||||
html = html.Replace($"\"{WebAppBasePath}", $"\"{WebAppBasePath}{_remoteBasePackagePath}/");
|
||||
if (WebAppBasePath != "./")
|
||||
{
|
||||
html = html.Replace($"\"{WebAppBasePath}", $"\"{WebAppBasePath}{_remoteBasePackagePath}/");
|
||||
}
|
||||
html = html.Replace($"\"./", $"\"{WebAppBasePath}{_remoteBasePackagePath}/");
|
||||
|
||||
w.Write(html);
|
||||
|
|
|
@ -22,7 +22,7 @@ const path = require("path");
|
|||
console.log('BROWSER LOG:', msg.text());
|
||||
});
|
||||
page.on('requestfailed', err => console.error('BROWSER-REQUEST-FAILED:', err));
|
||||
yield page.goto("http://localhost:8000/");
|
||||
yield page.goto(process.env.BOOTSTRAP_TEST_RUNNER_URL);
|
||||
var value = null;
|
||||
console.log(`Init puppeteer`);
|
||||
var counter = 3;
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"app.js","sourceRoot":"","sources":["app.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACvC,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE7B,CAAC,GAAS,EAAE;IACX,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC;QACtC,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,CAAC,cAAc,EAAE,0BAA0B,CAAC;QAClD,iBAAiB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;KACpD,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IACrC,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,CAAC,EAAE;QACxB,OAAO,CAAC,GAAG,CAAC,cAAc,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QACtC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;QAClB,IAAI;YACH,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;YACzD,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,EAAE,CAAC,CAAC;SACnC;QACD,OAAO,CAAC,EAAE;YACT,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,GAAG,CAAC,CAAC;SAC7C;KACD;IAED,MAAM,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,8BAA8B,eAAe,EAAE,CAAC,CAAC;IAE9F,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IAEtB,IAAI,CAAC,KAAK,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QAC1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KAChB;SAAM;QACN,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,EAAE,CAAC,CAAC;KACjC;AACF,CAAC,CAAA,CAAC,EAAE,CAAC;AAGL,SAAS,KAAK,CAAC,IAAI;IAClB,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO;QACnC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAC1B,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,SAAS;IACjB,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|
|
@ -14,7 +14,8 @@ const path = require("path");
|
|||
console.log('BROWSER LOG:', msg.text());
|
||||
});
|
||||
page.on('requestfailed', err => console.error('BROWSER-REQUEST-FAILED:', err))
|
||||
await page.goto("http://localhost:8000/");
|
||||
|
||||
await page.goto(process.env.BOOTSTRAP_TEST_RUNNER_URL);
|
||||
|
||||
var value = null;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче