Skip to content
Snippets Groups Projects
Commit df16af78 authored by Anders Harrisson's avatar Anders Harrisson
Browse files

Run unit tests in GitLab CI pipeline

parent 5c5866e5
No related branches found
No related tags found
1 merge request!5Run unit tests in GitLab CI pipeline
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
stages: stages:
# - check # - check
- build - build
# - test - test
# - analyse # - analyse
- release - release
...@@ -22,6 +22,28 @@ build-package: ...@@ -22,6 +22,28 @@ build-package:
paths: paths:
- dist/ - dist/
test:
stage: test
image: python:3
services:
- name: redis
variables:
HEALTHCHECK_TCP_PORT: "6379"
- name: postgres
variables:
POSTGRES_DB: netbox
POSTGRES_USER: netbox
POSTGRES_PASSWORD: netbox
HEALTHCHECK_TCP_PORT: "5432"
before_script:
- pip install .
- git clone --depth 1 --branch v3.7.8 --single-branch https://github.com/netbox-community/netbox.git
- pip install --upgrade --requirement netbox/requirements.txt
- ln -s $(pwd)/tests/configuration.py netbox/netbox/netbox/configuration.py
script:
- cd netbox
- python netbox/manage.py test netbox_awx_plugin
release-package: release-package:
stage: release stage: release
image: python:3 image: python:3
......
ALLOWED_HOSTS = ["*"]
DATABASE = {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'netbox',
'USER': 'netbox',
'PASSWORD': 'netbox',
'HOST': 'postgres',
'PORT': '',
'CONN_MAX_AGE': 300,
}
REDIS = {
'tasks': {
'HOST': 'redis',
'PORT': 6379,
'USERNAME': '',
'PASSWORD': '',
'DATABASE': 0,
'SSL': False,
},
'caching': {
'HOST': 'redis',
'PORT': 6379,
'USERNAME': '',
'PASSWORD': '',
'DATABASE': 1,
'SSL': False,
}
}
SECRET_KEY = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
PLUGINS = [
"netbox_awx_plugin",
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment