mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix: Broken subfolder tests in postgres/docker CI in master (#3559)
* disable failing tests for sanity check * run postgrest too * only run problematic tests * make paths relative * refactor to reduce duplicate code * remove testing restrictions again
This commit is contained in:
parent
b9f83eefc8
commit
0a57f9d459
2
.github/workflows/qc_checks.yaml
vendored
2
.github/workflows/qc_checks.yaml
vendored
@ -185,9 +185,7 @@ jobs:
|
||||
postgres:
|
||||
name: Tests - DB [PostgreSQL]
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
needs: [ 'javascript', 'html', 'pre-commit' ]
|
||||
if: github.event_name == 'push'
|
||||
|
||||
env:
|
||||
INVENTREE_DB_ENGINE: django.db.backends.postgresql
|
||||
|
@ -191,6 +191,10 @@ class InvenTreePluginTests(TestCase):
|
||||
class RegistryTests(TestCase):
|
||||
"""Tests for registry loading methods."""
|
||||
|
||||
def mockDir(self) -> None:
|
||||
"""Returns path to mock dir"""
|
||||
return str(Path(__file__).parent.joinpath('mock').absolute())
|
||||
|
||||
def run_package_test(self, directory):
|
||||
"""General runner for testing package based installs."""
|
||||
|
||||
@ -223,7 +227,7 @@ class RegistryTests(TestCase):
|
||||
|
||||
def test_subfolder_loading(self):
|
||||
"""Test that plugins in subfolders get loaded."""
|
||||
self.run_package_test('InvenTree/plugin/mock')
|
||||
self.run_package_test(self.mockDir())
|
||||
|
||||
def test_folder_loading(self):
|
||||
"""Test that plugins in folders outside of BASE_DIR get loaded."""
|
||||
@ -232,7 +236,7 @@ class RegistryTests(TestCase):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
# Fill directory with sample data
|
||||
new_dir = Path(tmp).joinpath('mock')
|
||||
shutil.copytree(Path('InvenTree/plugin/mock').absolute(), new_dir)
|
||||
shutil.copytree(self.mockDir(), new_dir)
|
||||
|
||||
# Run tests
|
||||
self.run_package_test(str(new_dir))
|
||||
|
Loading…
Reference in New Issue
Block a user