Skip to content

Commit

Permalink
ext test + run tests script fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Alzbeta Pokorna authored and Alzbeta Pokorna committed Nov 15, 2024
1 parent 33042a0 commit 6ed10af
Show file tree
Hide file tree
Showing 4 changed files with 327 additions and 12 deletions.
1 change: 1 addition & 0 deletions oarepo_model_builder/invenio/templates/ext.py.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class {{ vars.ext|class_header }}:

def init_app(self, app):
"""Flask application initialization."""
self.app = app
{% if vars.ext.base_classes %}
super().init_app(app=app)
{% endif %}
Expand Down
24 changes: 13 additions & 11 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@ initialize_server_venv() {
rm -rf $SERVER_VENV
fi

python3 -m venv $SERVER_VENV
python3.12 -m venv $SERVER_VENV
source $SERVER_VENV/bin/activate

$SERVER_VENV/bin/pip install -U setuptools pip wheel
$SERVER_VENV/bin/pip install "oarepo[tests]==${OAREPO_VERSION}.*"
$SERVER_VENV/bin/pip install -e complex-model



.venv-server/bin/pip install -U setuptools pip wheel nrp-devtools ~/cesnet/nr/temp/oarepo-runtime/
.venv-server/bin/nrp-devtools proxy 120 &
.venv-server/bin/pip install "oarepo[tests,rdm]==12.*" --index-url "http://127.0.0.1:4549/simple" --extra-index-url https://pypi.org/simple


.venv-server/bin/pip install -e complex-model --index-url "http://127.0.0.1:4549/simple" --extra-index-url https://pypi.org/simple
}

initialize_builder_venv() {
Expand All @@ -33,7 +39,7 @@ initialize_builder_venv() {
rm -rf $BUILDER_VENV
fi

python3 -m venv $BUILDER_VENV
python3.12 -m venv $BUILDER_VENV
. $BUILDER_VENV/bin/activate
$BUILDER_VENV/bin/pip install -U setuptools pip wheel
$BUILDER_VENV/bin/pip install -e '.[tests]'
Expand All @@ -45,10 +51,11 @@ initialize_client_test_venv() {
rm -rf $TEST_VENV
fi

python3 -m venv $TEST_VENV
python3.12 -m venv $TEST_VENV

$TEST_VENV/bin/pip install -U setuptools pip wheel
$TEST_VENV/bin/pip install requests PyYAML pytest

}

run_builder_tests() {
Expand Down Expand Up @@ -157,12 +164,7 @@ fi

cat complex-model/data/sample_data.yaml

$TEST_VENV/bin/nrp-devtools proxy 120 &

pip install "oarepo[tests,rdm]==${OAREPO_VERSION}.*" --index-url "http://127.0.0.1:4549/simple" --extra-index-url https://pypi.org/simple


pip install "./build-tests/${MODEL}[tests]" --index-url "http://127.0.0.1:4549/simple" --extra-index-url https://pypi.org/simple
$TEST_VENV/bin/pytest tests-model


Expand Down
Loading

0 comments on commit 6ed10af

Please sign in to comment.