ci: deduplicate constructing the ARTIFACTS_BASE_URL

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26670>
This commit is contained in:
Eric Engestrom
2023-12-13 17:39:11 +00:00
committed by Marge Bot
parent d024da3900
commit e46702f7ae
8 changed files with 7 additions and 9 deletions

View File

@@ -84,6 +84,7 @@ variables:
# Disable farm with `git mv .ci-farms{,-disabled}/$farm_name` # Disable farm with `git mv .ci-farms{,-disabled}/$farm_name`
# Re-enable farm with `git mv .ci-farms{-disabled,}/$farm_name` # Re-enable farm with `git mv .ci-farms{-disabled,}/$farm_name`
# NEVER MIX FARM MAINTENANCE WITH ANY OTHER CHANGE IN THE SAME MERGE REQUEST! # NEVER MIX FARM MAINTENANCE WITH ANY OTHER CHANGE IN THE SAME MERGE REQUEST!
ARTIFACTS_BASE_URL: https://${CI_PROJECT_ROOT_NAMESPACE}.${$CI_PAGES_DOMAIN}/-/${CI_PROJECT_NAME}/-/jobs/${CI_JOB_ID}/artifacts
default: default:
before_script: before_script:

View File

@@ -2,6 +2,7 @@
for var in \ for var in \
ACO_DEBUG \ ACO_DEBUG \
ARTIFACTS_BASE_URL \
ASAN_OPTIONS \ ASAN_OPTIONS \
BASE_SYSTEM_FORK_HOST_PREFIX \ BASE_SYSTEM_FORK_HOST_PREFIX \
BASE_SYSTEM_MAINLINE_HOST_PREFIX \ BASE_SYSTEM_MAINLINE_HOST_PREFIX \

View File

@@ -230,7 +230,7 @@ deqp-runner junit \
--results $RESULTS/failures.csv \ --results $RESULTS/failures.csv \
--output $RESULTS/junit.xml \ --output $RESULTS/junit.xml \
--limit 50 \ --limit 50 \
--template "See https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/results/{{testcase}}.xml" --template "See $ARTIFACTS_BASE_URL/results/{{testcase}}.xml"
# Report the flakes to the IRC channel for monitoring (if configured): # Report the flakes to the IRC channel for monitoring (if configured):
if [ -n "$FLAKES_CHANNEL" ]; then if [ -n "$FLAKES_CHANNEL" ]; then

View File

@@ -55,7 +55,7 @@ deqp-runner junit \
--results $RESULTS/failures.csv \ --results $RESULTS/failures.csv \
--output $RESULTS/junit.xml \ --output $RESULTS/junit.xml \
--limit 50 \ --limit 50 \
--template "See https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/results/{{testcase}}.xml" --template "See $ARTIFACTS_BASE_URL/results/{{testcase}}.xml"
# Report the flakes to the IRC channel for monitoring (if configured): # Report the flakes to the IRC channel for monitoring (if configured):
if [ -n "$FLAKES_CHANNEL" ]; then if [ -n "$FLAKES_CHANNEL" ]; then

View File

@@ -458,10 +458,8 @@ class LAVAJobSubmitter(PathResolver):
self.finish_script(last_attempt_job) self.finish_script(last_attempt_job)
def print_log_artifact_url(self): def print_log_artifact_url(self):
base_url = "https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/"
artifacts_path = "-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/"
relative_log_path = self.structured_log_file.relative_to(pathlib.Path.cwd()) relative_log_path = self.structured_log_file.relative_to(pathlib.Path.cwd())
full_path = f"{base_url}{artifacts_path}{relative_log_path}" full_path = f"$ARTIFACTS_BASE_URL/{relative_log_path}"
artifact_url = path.expandvars(full_path) artifact_url = path.expandvars(full_path)
print_log(f"Structural Logging data available at: {artifact_url}") print_log(f"Structural Logging data available at: {artifact_url}")

View File

@@ -106,7 +106,7 @@ deqp-runner junit \
--results $RESULTS/failures.csv \ --results $RESULTS/failures.csv \
--output $RESULTS/junit.xml \ --output $RESULTS/junit.xml \
--limit 50 \ --limit 50 \
--template "See https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/results/{{testcase}}.xml" --template "See $ARTIFACTS_BASE_URL/results/{{testcase}}.xml"
# Report the flakes to the IRC channel for monitoring (if configured): # Report the flakes to the IRC channel for monitoring (if configured):
if [ -n "$FLAKES_CHANNEL" ]; then if [ -n "$FLAKES_CHANNEL" ]; then

View File

@@ -190,8 +190,6 @@ then
printf "%s\n" "Found $(cat /tmp/version.txt), expected $MESA_VERSION" printf "%s\n" "Found $(cat /tmp/version.txt), expected $MESA_VERSION"
fi fi
ARTIFACTS_BASE_URL="https://${CI_PROJECT_ROOT_NAMESPACE}.${CI_PAGES_DOMAIN}/-/${CI_PROJECT_NAME}/-/jobs/${CI_JOB_ID}/artifacts"
./piglit summary aggregate "$RESULTS" -o junit.xml ./piglit summary aggregate "$RESULTS" -o junit.xml
PIGLIT_RESULTS="${PIGLIT_RESULTS:-replay}" PIGLIT_RESULTS="${PIGLIT_RESULTS:-replay}"

View File

@@ -27,7 +27,7 @@ deqp-runner suite --suite $($suite) `
$jobs $jobs
$deqpstatus = $? $deqpstatus = $?
$template = "See https://$($env:CI_PROJECT_ROOT_NAMESPACE).pages.freedesktop.org/-/$($env:CI_PROJECT_NAME)/-/jobs/$($env:CI_JOB_ID)/artifacts/results/{{testcase}}.xml" $template = "See $($env:ARTIFACTS_BASE_URL)/results/{{testcase}}.xml"
deqp-runner junit --testsuite dEQP --results "$($results)/failures.csv" --output "$($results)/junit.xml" --limit 50 --template $template deqp-runner junit --testsuite dEQP --results "$($results)/failures.csv" --output "$($results)/junit.xml" --limit 50 --template $template
Copy-Item -Path "C:\deqp\testlog.css" -Destination $($results) Copy-Item -Path "C:\deqp\testlog.css" -Destination $($results)
Copy-Item -Path "C:\deqp\testlog.xsl" -Destination $($results) Copy-Item -Path "C:\deqp\testlog.xsl" -Destination $($results)