summaryrefslogtreecommitdiff
path: root/tests/unit/test_web.py
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@redhat.com>2019-01-02 15:23:14 -0800
committerJames E. Blair <jeblair@redhat.com>2019-01-04 14:01:23 -0800
commitb7c68c2f76a6d3bf90718407ba16cc06c91708e8 (patch)
tree57c8dfde2c05179e0459abe23623adb309765170 /tests/unit/test_web.py
parent7d3ad9a7aa0f1bebf54ece9ec390948e8e16b3c2 (diff)
downloadzuul-b7c68c2f76a6d3bf90718407ba16cc06c91708e8.tar.gz
Combine artifact URLs with log_url if relative
The plan for the idea of a "promote" pipeline is to fetch previously uploaded artifacts from the build log server and move them to the final publication location. However, jobs which store data (such as documentation builds, tarballs, or container images) on the log server should not need to know the configuration of the log server in order to return the artifact URL to zuul. To support this, if the job returns a relative URL for an artifact, assume it is relative to the log URL for the build and combine the two when storing the artifact info. Change-Id: I4bce2401c9e59fd469e3b3da2973514c07faecf2
Diffstat (limited to 'tests/unit/test_web.py')
-rwxr-xr-xtests/unit/test_web.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/unit/test_web.py b/tests/unit/test_web.py
index 716f2f91f..632a0a2c6 100755
--- a/tests/unit/test_web.py
+++ b/tests/unit/test_web.py
@@ -701,10 +701,12 @@ class TestArtifacts(ZuulDBTestCase, BaseTestWeb, AnsibleZuulTestCase):
"project=org/project&"
"job_name=project-test1").json()
self.assertEqual(len(build_query), 1)
- self.assertEqual(len(build_query[0]['artifacts']), 2)
+ self.assertEqual(len(build_query[0]['artifacts']), 3)
self.assertEqual(build_query[0]['artifacts'], [
{'url': 'http://example.com/tarball',
'name': 'tarball'},
{'url': 'http://example.com/docs',
'name': 'docs'},
+ {'url': 'http://logs.example.com/build/relative/docs',
+ 'name': 'relative'},
])