Skip to content

Commit 08773cc

Browse files
committed
Do not set GITHUB_ACTIONS env var when running tests
1 parent 40ee23d commit 08773cc

File tree

3 files changed

+3
-40
lines changed

3 files changed

+3
-40
lines changed

.github/workflows/pytest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: pytest
22
on:
3-
pull_request_target:
3+
pull_request:
44
branches:
55
- "**"
66
push:
@@ -52,7 +52,7 @@ jobs:
5252
db
5353
web_server
5454
- name: Run unit tests (pytest)
55-
run: docker-compose run -e GITHUB_ACTIONS=true -v /tmp:/tmp --no-deps web_server bash -o pipefail -c 'source
55+
run: docker-compose run -v /tmp:/tmp --no-deps web_server bash -o pipefail -c 'source
5656
env/bin/activate && pip3 install -r requirements.txt &&
5757
pytest -vv --ignore alws/ --cov-report term-missing:skip-covered
5858
--cov-report xml:/tmp/coverage.xml --junitxml=/tmp/pytest.xml --cov=alws

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,6 @@ services:
528528

529529
sign_file:
530530
image: sign-file:latest
531-
env_file:
532-
- ../albs-sign-file/.env
533531
build:
534532
dockerfile: Dockerfile
535533
context: ../albs-sign-file

tests/test_scripts/test_packages_exporter.py

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,7 @@
1010

1111

1212
@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-
"""
13+
reason="See https://github.com/AlmaLinux/build-system/issues/204"
4914
)
5015
def test_repomd_signer():
5116
exporter = Exporter(

0 commit comments

Comments
 (0)