2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-15 03:25:42 +00:00

Fix unit tests (#6932)

* Fix unit test

* Fix script pathing

* Fix pathing in version_check.py

* Fix mkdocs.yml
This commit is contained in:
Oliver
2024-04-03 17:50:13 +11:00
committed by GitHub
parent 5bec4ebb0e
commit 6be2ede5e8
4 changed files with 7 additions and 38 deletions

View File

@ -92,7 +92,9 @@ def check_version_number(version_string, allow_duplicate=False):
if __name__ == '__main__':
if 'only_version' in sys.argv:
here = Path(__file__).parent.absolute()
version_file = here.joinpath('..', 'InvenTree', 'InvenTree', 'api_version.py')
version_file = here.joinpath(
'..', '..', 'src', 'backend', 'InvenTree', 'InvenTree', 'api_version.py'
)
text = version_file.read_text()
results = re.findall(r"""INVENTREE_API_VERSION = (.*)""", text)
print(results[0])

View File

@ -157,7 +157,7 @@ jobs:
if: needs.paths-filter.outputs.api == 'false'
run: |
pip install requests==2.31.0 >/dev/null 2>&1
version="$(python3 ci/version_check.py only_version 2>&1)"
version="$(python3 .github/scripts/version_check.py only_version 2>&1)"
echo "Version: $version"
url="https://raw.githubusercontent.com/inventree/schema/main/export/${version}/api.yaml"
echo "URL: $url"
@ -176,7 +176,7 @@ jobs:
if: github.ref == 'refs/heads/master' && needs.paths-filter.outputs.api == 'true'
run: |
pip install requests==2.31.0 >/dev/null 2>&1
version="$(python3 ci/version_check.py only_version 2>&1)"
version="$(python3 .github/scripts/version_check.py only_version 2>&1)"
echo "Version: $version"
echo "version=$version" >> "$GITHUB_OUTPUT"