Skip to content

Commit 07f8cf6

Browse files
authored
Merge pull request codeaffen#43 from cmeissner/test_setup
Prepare automatic tests
2 parents 9566611 + a1a4c61 commit 07f8cf6

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

.github/workflows/main.yml

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ jobs:
1616
with:
1717
python-version: '3.x'
1818
- name: Prepare test environment
19+
env:
20+
PHPIPAM_URL: ${{ secrets.PHPIPAM_URL }}
21+
PHPIPAM_APPID: ${{ secrets.PHPIPAM_APPID }}
22+
PHPIPAM_USERNAME: ${{ secrets.PHPIPAM_USERNAME }}
23+
PHPIPAM_PASSWORD: ${{ secrets.PHPIPAM_PASSWORD }}
1924
run: |
2025
python -m pip install --upgrade pip
2126
make test-setup

Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ test-setup: | tests/vars/server.yml
6060
pip install --upgrade -r requirements-dev.txt
6161

6262
tests/vars/server.yml:
63-
cp $@.example $@
64-
@echo "Please configure $@ to point to your phpIPAM instance for recording."
63+
sed -e "s#~~url~~#$(PHPIPAM_URL)#" -e "s#~~app_id~~#$(PHPIPAM_APPID)#" -e "s#~~username~~#$(PHPIPAM_USERNAME)#" -e "s#~~password~~#$(PHPIPAM_PASSWORD)#" $@.example > $@
6564

6665
test-all:
6766
coverage run -m pytest tests/test_cases/* -v

tests/vars/server.yml.example

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Parameter for all tests
2-
url: 'https://ipam.example.com'
3-
app_id: my_app
4-
username: user
5-
password: p455w0rd
2+
url: ~~url~~
3+
app_id: ~~app_id~~
4+
username: ~~username~~
5+
password: ~~password~~

0 commit comments

Comments
 (0)