-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #567 from sennetconsortium/tjmadonna/496-tests
Tjmadonna/496 tests
- Loading branch information
Showing
42 changed files
with
1,764 additions
and
4,088 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# check if the neo4j-test docker container is running and stop it | ||
if [ "$(docker ps -q -f name=neo4j-test)" ]; then | ||
echo "Stopping the existing neo4j-test container" | ||
docker stop neo4j-test > /dev/null | ||
fi | ||
|
||
# check if the neo4j-test docker container exists and remove it | ||
if [ "$(docker ps -aq -f name=neo4j-test)" ]; then | ||
echo "Removing the existing neo4j-test container" | ||
docker rm neo4j-test > /dev/null | ||
fi | ||
|
||
# create a new neo4j-test docker container | ||
echo "Creating a new neo4j-test container" | ||
docker run -d \ | ||
--name neo4j-test \ | ||
-p 7474:7474 \ | ||
-p 7687:7687 \ | ||
-e NEO4J_AUTH=none \ | ||
-e NEO4JLABS_PLUGINS=\[\"apoc\"\] \ | ||
neo4j:5.20.0-ubi8 | ||
|
||
# Read values from config file and set them as environment variables | ||
UBKG_SERVER=$(awk -F ' = ' '/UBKG_SERVER/ {print $2}' src/instance/app.cfg | tr -d '[:space:]' | sed "s/^'//;s/'$//") | ||
UBKG_ENDPOINT_VALUESET=$(awk -F ' = ' '/UBKG_ENDPOINT_VALUESET/ {print $2}' src/instance/app.cfg | tr -d '[:space:]' | sed "s/^'//;s/'$//") | ||
UBKG_CODES=$(awk -F ' = ' '/UBKG_CODES/ {print $2}' src/instance/app.cfg | tr -d '[:space:]' | sed "s/^'//;s/'$//") | ||
|
||
# Set the test config file and backup the original config file | ||
mv src/instance/app.cfg src/instance/app.cfg.bak | ||
cp test/config/app.test.cfg src/instance/app.cfg | ||
|
||
echo "Running tests" | ||
UBKG_SERVER=$UBKG_SERVER \ | ||
UBKG_ENDPOINT_VALUESET=$UBKG_ENDPOINT_VALUESET \ | ||
UBKG_CODES=$UBKG_CODES \ | ||
pytest -W ignore::DeprecationWarning | ||
|
||
# Restore the original config file | ||
mv src/instance/app.cfg.bak src/instance/app.cfg | ||
|
||
echo "Stopping and removing the neo4j-test container" | ||
docker stop neo4j-test > /dev/null | ||
docker rm --volumes neo4j-test > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pytest_plugins = ["test.helpers.auth", "test.helpers.database", "test.helpers.request"] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.