diff options
author | James E. Blair <jeblair@redhat.com> | 2019-01-02 15:23:14 -0800 |
---|---|---|
committer | James E. Blair <jeblair@redhat.com> | 2019-01-04 14:01:23 -0800 |
commit | b7c68c2f76a6d3bf90718407ba16cc06c91708e8 (patch) | |
tree | 57c8dfde2c05179e0459abe23623adb309765170 /tests/unit/test_web.py | |
parent | 7d3ad9a7aa0f1bebf54ece9ec390948e8e16b3c2 (diff) | |
download | zuul-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-x | tests/unit/test_web.py | 4 |
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'}, ]) |