|
9 | 9 | IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") is not None |
10 | 10 |
|
11 | 11 |
|
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 | + """ |
14 | 49 | ) |
15 | 50 | def test_repomd_signer(): |
16 | 51 | exporter = Exporter( |
|
0 commit comments