Skip to content

Commit 45dfee3

Browse files
committed
Add a test for rpm
The test file is taken from: ```bash ❯ wget https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/b/bdsync-0.11.2-1.el7.x86_64.rpm ``` And a few minor tidyups in invoke. Push a new docker image with this update.
1 parent 51b741a commit 45dfee3

File tree

5 files changed

+29
-14
lines changed

5 files changed

+29
-14
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
3434
python3-dev \
3535
python3-pip \
3636
python3-venv \
37+
rpm2cpio \
3738
sudo \
3839
tk-dev \
3940
unrar \

README.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pyversions](https://img.shields.io/pypi/pyversions/dtrx.svg?style=for-the-badge&
1313
- [Contributions](#contributions)
1414
- [Issues](#issues)
1515
- [Releases](#releases)
16-
- [Tests](#tests)
16+
- [Invoke + Tests](#invoke--tests)
1717
- [Linting](#linting)
1818
- [Docker](#docker)
1919

@@ -96,23 +96,29 @@ for maintainers is the below steps:
9696

9797
See the [`Makefile`](Makefile) for details on what that rule does.
9898

99-
### Tests
99+
### Invoke + Tests
100100

101-
There is a suite of tests that can be run either on the local python
102-
environment, or across all the supported python environments via docker:
101+
There's some minimal helper scripts for pyinvoke in [`tasks.py`](tasks.py).
103102

104-
```bash
105-
# run the suite from the current python environment
106-
pip install pyyaml # test dependency
107-
python tests/compare.py
108-
109-
# run the tests in docker across all supported python versions (takes a while)
110-
./test.sh
103+
To bootstrap, run `pip install -r requirements.txt`, then `inv --list` to see
104+
available tasks:
111105

112-
# run the tests in docker on one python version
113-
RUN_JOB=quick-test ./test.sh
106+
```bash
107+
❯ inv --list
108+
Available tasks:
109+
110+
build-docker build docker image
111+
push-docker push docker image
112+
quick-test run quick tests in docker
113+
rst2man run rst2man in docker
114+
test-nonexistent-file-cmd run test-nonexistent-file-cmd.sh
115+
tox run tox in docker
116+
windows just check that windows install fails. pulls a minimal wine docker image to test
114117
```
115118

119+
To run the tests, run `inv tox`. Takes a couple of minutes to go through all the
120+
python versions.
121+
116122
### Linting
117123

118124
Linting is provided by [pre-commit](pre-commit.com). To use it, first install
@@ -144,7 +150,7 @@ then be updated in the GitHub actions runner.
144150
> error handling when the output directory is not accessible by the current
145151
> user). To deal with this, there's an entrypoint script that switches user to a
146152
> non-root user, but that still has read/write access to the mounted host volume
147-
> (which is the cwd, intended for local developement work). This is required on
153+
> (which is the cwd, intended for local development work). This is required on
148154
> Linux, where it's nice to have the host+container UID+GUID matching, so any
149155
> changes to the mounted host volume have the same permissions set.
150156
>

tasks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def test_nonexistent_file_cmd(ctx):
8282

8383
@invoke.task
8484
def windows(ctx):
85+
"""just check that windows install fails. pulls a minimal wine docker image to test"""
8586
if in_docker():
8687
print("error: this should not be run in docker!")
8788
sys.exit(1)

tests/test.rpm

38.8 KB
Binary file not shown.

tests/tests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,3 +910,10 @@
910910
zip
911911
zst
912912
zstd
913+
914+
- name: rpm
915+
filenames: test.rpm
916+
baseline: |
917+
mkdir test
918+
cd test
919+
rpm2cpio ../$1 | cpio -i --make-directories --quiet --no-absolute-filenames

0 commit comments

Comments
 (0)