From: "Arthur Zamarin" <arthurzam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/pkgcore/pkgcheck:master commit in: testdata/repos/network/MetadataUrlCheck/RedirectedUrl/, ...
Date: Sat, 22 Oct 2022 08:57:49 +0000 (UTC) [thread overview]
Message-ID: <1666428911.807e6229e5ebc20f8372d053af47577dee74ccd2.arthurzam@gentoo> (raw)
commit: 807e6229e5ebc20f8372d053af47577dee74ccd2
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 22 08:55:11 2022 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Oct 22 08:55:11 2022 +0000
URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=807e6229
tests: fix flaky network scan MetadataUrlCheck/RedirectedUrl
Because of undefined order between requests call by the check (as they
are performed in parallel), the test could fail if there was no match
with the expected requests replies.
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
.../MetadataUrlCheck/RedirectedUrl/expected.json | 1 -
.../MetadataUrlCheck/RedirectedUrl/metadata.xml | 1 -
.../MetadataUrlCheck/RedirectedUrl/responses.py | 29 ++++++----------------
3 files changed, 7 insertions(+), 24 deletions(-)
diff --git a/testdata/data/repos/network/MetadataUrlCheck/RedirectedUrl/expected.json b/testdata/data/repos/network/MetadataUrlCheck/RedirectedUrl/expected.json
index ef65eafc..5b515d16 100644
--- a/testdata/data/repos/network/MetadataUrlCheck/RedirectedUrl/expected.json
+++ b/testdata/data/repos/network/MetadataUrlCheck/RedirectedUrl/expected.json
@@ -1,3 +1,2 @@
-{"__class__": "RedirectedUrl", "category": "MetadataUrlCheck", "package": "RedirectedUrl", "version": "0", "attr": "metadata.xml: changelog", "url": "https://github.com/pkgcore/pkgcheck/changelog", "new_url": "https://github.com/pkgcore/pkgcheck/news"}
{"__class__": "RedirectedUrl", "category": "MetadataUrlCheck", "package": "RedirectedUrl", "version": "0", "attr": "metadata.xml: remote-id", "url": "https://github.com/pkgcore/pkgcheck", "new_url": "https://github.com/pkgcore/pkgcheck/"}
{"__class__": "RedirectedUrl", "category": "MetadataUrlCheck", "package": "RedirectedUrl", "version": "0", "attr": "metadata.xml: doc", "url": "https://github.com/pkgcore/pkgcheck", "new_url": "https://github.com/pkgcore/pkgcheck/"}
diff --git a/testdata/repos/network/MetadataUrlCheck/RedirectedUrl/metadata.xml b/testdata/repos/network/MetadataUrlCheck/RedirectedUrl/metadata.xml
index 97b42470..522f6234 100644
--- a/testdata/repos/network/MetadataUrlCheck/RedirectedUrl/metadata.xml
+++ b/testdata/repos/network/MetadataUrlCheck/RedirectedUrl/metadata.xml
@@ -4,6 +4,5 @@
<upstream>
<remote-id type="github">pkgcore/pkgcheck</remote-id>
<doc>https://github.com/pkgcore/pkgcheck</doc>
- <changelog>https://github.com/pkgcore/pkgcheck/changelog</changelog>
</upstream>
</pkgmetadata>
diff --git a/testdata/repos/network/MetadataUrlCheck/RedirectedUrl/responses.py b/testdata/repos/network/MetadataUrlCheck/RedirectedUrl/responses.py
index 0c4e3565..7567a614 100644
--- a/testdata/repos/network/MetadataUrlCheck/RedirectedUrl/responses.py
+++ b/testdata/repos/network/MetadataUrlCheck/RedirectedUrl/responses.py
@@ -1,21 +1,6 @@
import io
from requests.models import Response
-
-r_hist = Response()
-r_hist.status_code = 301
-r_hist.reason = 'Moved Permanently'
-r_hist.url = 'https://github.com/pkgcore/pkgcheck/changelog'
-r_hist.headers = {'location': 'https://github.com/pkgcore/pkgcheck/news'}
-r_hist.raw = io.StringIO()
-
-r1 = Response()
-r1.status_code = 200
-r1.reason = 'OK'
-r1.url = 'https://github.com/pkgcore/pkgcheck/changelog'
-r1.raw = io.StringIO()
-r1.history = [r_hist]
-
r_hist = Response()
r_hist.status_code = 301
r_hist.reason = 'Moved Permanently'
@@ -23,11 +8,11 @@ r_hist.url = 'https://github.com/pkgcore/pkgcheck'
r_hist.headers = {'location': 'https://github.com/pkgcore/pkgcheck/'}
r_hist.raw = io.StringIO()
-r2 = Response()
-r2.status_code = 301
-r2.reason = 'OK'
-r2.url = 'https://github.com/pkgcore/pkgcheck'
-r2.raw = io.StringIO()
-r2.history = [r_hist]
+r = Response()
+r.status_code = 301
+r.reason = 'OK'
+r.url = 'https://github.com/pkgcore/pkgcheck'
+r.raw = io.StringIO()
+r.history = [r_hist]
-responses = [r1, r2]
+responses = [r]
reply other threads:[~2022-10-22 8:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1666428911.807e6229e5ebc20f8372d053af47577dee74ccd2.arthurzam@gentoo \
--to=arthurzam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox