Skip to content

Commit 4137110

Browse files
committed
Skip packages_exporter test
It needs to be refactored.
1 parent 8a43f63 commit 4137110

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

tests/test_scripts/test_packages_exporter.py

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,43 @@
99
IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") is not None
1010

1111

12-
@pytest.mark.skipif(
13-
IN_GITHUB_ACTIONS, reason="Test doesn't work in Github Actions."
12+
@pytest.mark.skip(
13+
reason="""
14+
This test needs to be rewritten.
15+
16+
First, it needs to be converted into an async test.
17+
18+
We need to bring up a configured sign_file instance when setting up the
19+
test environment. This is, prepare everything to run:
20+
21+
`docker compose run --no-deps web_server db sign_file ...`
22+
23+
The sign_file service should:
24+
* Have a user inside db
25+
* A key in gpg database
26+
27+
Also, there is no point in getting the sign_keys from web_server as we
28+
haven't loaded any keys into testing db. We should load sign keys into
29+
db to request keys from web_server if we want this test to work that
30+
way. Which can be easily done using a fixture.
31+
In any case, I propose to, simply, pass the key_id of the key(s) that
32+
we add into sign_file service when setting up the test environment and
33+
skip the call to `exporter.get_sign_keys`, which can be tested
34+
elsewhere, but not in this file.
35+
36+
Bear in mind that the exporter should know the sign_file user
37+
credentials as they are used to request a token from sign_file
38+
service.
39+
40+
pytest's tmp_path fixture can be of help to deal with tmp_files,
41+
i.e.:
42+
```
43+
def test_repomd_signer(tmp_path: Path):
44+
tmp_file = tmp_path / "file.txt"
45+
tmp_file.write_bytes(b"Hello world!")
46+
...
47+
```
48+
"""
1449
)
1550
def test_repomd_signer():
1651
exporter = Exporter(

0 commit comments

Comments
 (0)