Skip to content

Commit

Permalink
Tests: execute tests in tmpfs context (folder)
Browse files Browse the repository at this point in the history
Whenever tests start, they might do some enviromental
changes to local FS. Handle this by moving
the 'context' of tests execution to a tmpfs folder, that
can be easily purged after tests are done / new test run
is being executed.

NOTE: further changes in regard to tests isolation should
potentially utilize a separate docker container that serves
as a fresh clean and isolated enviroment for tests run.

Signed-off-by: Oleksandr Mazur <[email protected]>
  • Loading branch information
Cahb committed Dec 11, 2024
1 parent 90004e9 commit 8b1d304
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ pytest==8.3.3
randmac==0.1
psycopg2-binary==2.9.10
redis==5.2.0
requests==2.32.3
8 changes: 8 additions & 0 deletions tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

# Separate exports for clearer visibility of _what exactly_
# we're putting in python path

rm -rf /tmp/cgw_tests_runner;
mkdir /tmp/cgw_tests_runner && \
cp -rf ../tests /tmp/cgw_tests_runner/ && \
cp -rf ../utils /tmp/cgw_tests_runner/;

cd /tmp/cgw_tests_runner/tests

export PYTHONPATH="$PYTHONPATH:$PWD"
export PYTHONPATH="$PYTHONPATH:$PWD/../utils"

Expand Down

0 comments on commit 8b1d304

Please sign in to comment.