diff options
| author | Tom Rini <[email protected]> | 2025-05-30 10:26:33 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-05-30 11:19:45 -0600 |
| commit | 5eb1b7843811e3e87b0e677212a9145f07552a60 (patch) | |
| tree | 4cb70288edeec4d3cee69e4b66f5f4a3a14c01b6 /.azure-pipelines.yml | |
| parent | e15282f943b42647478ec158011656df7cf12ec2 (diff) | |
| parent | ec1d9f3fe81708ef7e5e45a46564f286404a7aba (diff) | |
Merge patch series "test/py: enable HTTP testing"
Adriano Cordova <[email protected]> says:
Enable HTTP server in CI to support HTTP tests in pytest
QEMU does not emulate an HTTP server, unlike other services like DHCP or TFTP.
To enable HTTP tests during CI runs, start a simple Python HTTP server
on port 80. This allows tests that require HTTP access to run.
The HTTP server is launched on the host. For QEMU environments launched
with '-netdev,user' this means that the HTTP server runs together with DHCP
at 10.0.2.2. HTTP testing needs to be explicitly enabled with
env__efi_helloworld_net_http_test_skip = False.
We also default `WGET=y` in `ARCH_QEMU` configurations so that these HTTP
tests are included automatically when using QEMU in CI.
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to '.azure-pipelines.yml')
| -rw-r--r-- | .azure-pipelines.yml | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 15520c4dafd..b3fd4ceef13 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -316,9 +316,20 @@ stages: fi export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:\${PATH} export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci + python3 -m http.server 80 --directory "\${UBOOT_TRAVIS_BUILD_DIR}" > /dev/null 2>&1 & + HTTP_PID=\$! + sleep 1 # Give the server a moment to start + if ps -p \${HTTP_PID} > /dev/null; then + export HTTP_PID + else + unset HTTP_PID + fi # "\${var:+"-k \$var"}" expands to "" if \$var is empty, "-k \$var" if not ./test/py/test.py -ra -o cache_dir="\$UBOOT_TRAVIS_BUILD_DIR"/.pytest_cache --bd \${TEST_PY_BD} \${TEST_PY_ID} \${TEST_PY_EXTRA} \${TEST_PY_TEST_SPEC:+"-k \${TEST_PY_TEST_SPEC}"} --build-dir "\$UBOOT_TRAVIS_BUILD_DIR" --report-dir "\$UBOOT_TRAVIS_BUILD_DIR" --junitxml=\$(System.DefaultWorkingDirectory)/results.xml # the below corresponds to .gitlab-ci.yml "after_script" + if [[ -n "\${HTTP_PID}" ]]; then + kill \${HTTP_PID}; + fi rm -rf /tmp/uboot-test-hooks /tmp/venv EOF - task: CopyFiles@2 |
