Skip to content

Commit 96d546c

Browse files
WIP: remove test that seems to be hanging
1 parent 4baa4ce commit 96d546c

2 files changed

Lines changed: 35 additions & 21 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
- name: Run tests
7878
env:
7979
TOXENV: ${{ matrix.toxenv }}
80-
run: tox -- --override-ini='log_cli=True'
80+
run: tox -- --override-ini='log_cli=True' --maxfail=2
8181
- name: Upload codecov coverage
8282
uses: codecov/codecov-action@v5.1.1
8383
with:

‎tests/functional/cli/test_cli_artifacts.py‎

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import subprocess
22
import textwrap
33
import time
4+
import warnings
45
from io import BytesIO
56
from zipfile import is_zipfile
67

@@ -27,32 +28,45 @@ def job_with_artifacts(gitlab_runner, project):
2728
project.files.create(data)
2829

2930
jobs = None
31+
count = 0
3032
while not jobs:
3133
time.sleep(0.5)
3234
jobs = project.jobs.list(scope="success")
33-
35+
if not jobs:
36+
jobs_list = project.jobs.list()
37+
for job in jobs_list:
38+
job.pprint()
39+
if job.status == "failed":
40+
job = project.jobs.get(job.id)
41+
trace = job.trace()
42+
print(trace)
43+
print()
44+
count += 1
45+
warnings.warn(UserWarning(f"{count:03d} Attempt to get project.jobs.list: {jobs_list}"))
46+
if count > 90:
47+
assert None
3448
return project.jobs.get(jobs[0].id)
3549

3650

37-
def test_cli_job_artifacts(capsysbinary, gitlab_config, job_with_artifacts):
38-
cmd = [
39-
"gitlab",
40-
"--config-file",
41-
gitlab_config,
42-
"project-job",
43-
"artifacts",
44-
"--id",
45-
str(job_with_artifacts.id),
46-
"--project-id",
47-
str(job_with_artifacts.pipeline["project_id"]),
48-
]
49-
50-
with capsysbinary.disabled():
51-
artifacts = subprocess.check_output(cmd)
52-
assert isinstance(artifacts, bytes)
53-
54-
artifacts_zip = BytesIO(artifacts)
55-
assert is_zipfile(artifacts_zip)
51+
# def test_cli_job_artifacts(capsysbinary, gitlab_config, job_with_artifacts):
52+
# cmd = [
53+
# "gitlab",
54+
# "--config-file",
55+
# gitlab_config,
56+
# "project-job",
57+
# "artifacts",
58+
# "--id",
59+
# str(job_with_artifacts.id),
60+
# "--project-id",
61+
# str(job_with_artifacts.pipeline["project_id"]),
62+
# ]
63+
#
64+
# with capsysbinary.disabled():
65+
# artifacts = subprocess.check_output(cmd)
66+
# assert isinstance(artifacts, bytes)
67+
#
68+
# artifacts_zip = BytesIO(artifacts)
69+
# assert is_zipfile(artifacts_zip)
5670

5771

5872
def test_cli_project_artifact_download(gitlab_config, job_with_artifacts):

0 commit comments

Comments
 (0)