Skip to content

Commit 8c1bf8f

Browse files
committed
Introduce tests and autotests in GitHub CI/CD
1 parent e6da1e0 commit 8c1bf8f

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
jobs:
2+
test:
3+
strategy:
4+
matrix:
5+
python-version: ["3.12", "3.11", "3.10", "3.9", "3.8", "3.7"]
6+
os: ["ubuntu-22.04"]
7+
8+
runs-on: ${{ matrix.os }}
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Include ppa repository
12+
run: sudo add-apt-repository ppa:deadsnakes/ppa
13+
- name: Set up Python ${{ matrix.python-version }}
14+
run: |
15+
sudo apt-get install python${{ matrix.python-version }}-dev
16+
sudo update-alternatives --install /usr/bin/python3 python3 `which python${{ matrix.python-version }}` 1
17+
sudo update-alternatives --install /usr/bin/python3-config python3-config `which python${{ matrix.python-version }}-config` 1
18+
- name: Install requirements for testing
19+
run: sudo python3 -m pip install mockito
20+
- name: Run tests
21+
run: python3 -m unittest tests

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,15 @@ and thus not have the client download them automatically.
9898
- `qlx_workshopReferences`: A comma-separated list of workshop IDs for items you want to force the client to download.
9999
Use this for custom resources, such as sounds packs and whatnot.
100100

101+
## Develop
102+
103+
To run unittests, use following commands:
104+
105+
```
106+
git submodule update
107+
python3 -m pip install mockito
108+
python3 -m unittest tests
109+
```
110+
101111
## Contribute
102112
If you create pull requests, please try to not deviate from the coding style of the plugins (e.g. don't use camelCase variable names and stuff like that), and please create the PR against the develop branch of the repository.

0 commit comments

Comments
 (0)