Test for docker workflow (#4014)

* Test for docker workflow

* Ensure yaml is installed in the local env

* Install the right package

* Debug yaml path

* Check data directory first

* Let them run

* More debug info

* Try reverting a recent change

* Disable test

* Check envvar directory

* Remove debug prints

* Re-enable unit test

* Use os.getenv

* Prevent docker workflow from running on pull requests

* Re-add InvenTree.helpers import
This commit is contained in:
Oliver 2022-12-05 13:10:14 +11:00 committed by GitHub
parent e22db29862
commit 4ad88c7822
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -38,10 +38,10 @@ jobs:
uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # pin@v4.3.0
with:
python-version: ${{ env.python_version }}
cache: 'pip'
- name: Version Check
run: |
pip install requests
pip install pyyaml
python3 ci/version_check.py
echo "git_commit_hash=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "git_commit_date=$(git show -s --format=%ci)" >> $GITHUB_ENV
@ -55,10 +55,6 @@ jobs:
docker-compose run inventree-dev-server invoke setup-dev
docker-compose up -d
docker-compose run inventree-dev-server invoke wait
- name: Run Unit Tests
run: |
docker-compose run inventree-dev-server invoke test
docker-compose down
- name: Check Data Directory
# The following file structure should have been created by the docker image
run: |
@ -71,6 +67,10 @@ jobs:
test -f data/config.yaml
test -f data/plugins.txt
test -f data/secret_key.txt
- name: Run Unit Tests
run: |
docker-compose run inventree-dev-server invoke test
docker-compose down
- name: Set up QEMU
if: github.event_name != 'pull_request'
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # pin@v2.1.0

View File

@ -10,6 +10,7 @@ import hmac
import json
import logging
import math
import os
import uuid
from datetime import datetime, timedelta
from enum import Enum
@ -1371,7 +1372,7 @@ class InvenTreeSetting(BaseInvenTreeSetting):
'PLUGIN_ON_STARTUP': {
'name': _('Check plugins on startup'),
'description': _('Check that all plugins are installed on startup - enable in container environments'),
'default': settings.DOCKER,
'default': os.getenv('INVENTREE_DOCKER', False),
'validator': bool,
'requires_restart': True,
},