From 1f59ac8aa870a2736240c2a92320a41d34da5625 Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 13:03:18 -0400 Subject: [PATCH 01/23] test --- .github/workflows/loristest.yml | 13 ++----------- test/Dockerfile.test.py | 14 ++++++++++++++ test/docker-compose.yml | 8 +++++++- test/test_example.py | 7 +++++++ 4 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 test/Dockerfile.test.py create mode 100644 test/test_example.py diff --git a/.github/workflows/loristest.yml b/.github/workflows/loristest.yml index 1937f107b..ac4a84e4e 100644 --- a/.github/workflows/loristest.yml +++ b/.github/workflows/loristest.yml @@ -78,15 +78,6 @@ jobs: cd Loris make dev - - name: Run Test Suite + - name: Build and run Docker Compose run: | - # set sandbox to 1 before running the tests - # since some tests only run in sandbox environments - sed -i 's/0<\/sandbox>/1<\/sandbox>/g' Loris/test/config.xml - cd Loris - npm run tests:${{ matrix.testsuite }} - env: - # Specifies how many jobs you would like to run in parallel, - CI_NODE_TOTAL: ${{ matrix.ci_node_total }} - # Use the index from matrix as an environment variable - CI_NODE_INDEX: ${{ matrix.ci_node_index }} + docker compose up --build --exit-code-from pytest diff --git a/test/Dockerfile.test.py b/test/Dockerfile.test.py new file mode 100644 index 000000000..62b2287bf --- /dev/null +++ b/test/Dockerfile.test.py @@ -0,0 +1,14 @@ +# Dockerfile +FROM python:3.11.3-slim + +WORKDIR /app + +# Copy test files into the container +COPY test /app/test + +# Install pytest +RUN pip install pytest + +# Set the default command to run tests +CMD ["pytest", "/app/test"] + diff --git a/test/docker-compose.yml b/test/docker-compose.yml index 55794465d..973f6f14d 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -1,5 +1,11 @@ -version: '2' +version: '3' services: + pytest: + build: + context: . + dockerfile: Dockerfile.test.py + command: pytest /app/test + db: build: context: . diff --git a/test/test_example.py b/test/test_example.py new file mode 100644 index 000000000..b2d513e5a --- /dev/null +++ b/test/test_example.py @@ -0,0 +1,7 @@ +# tests/test_example.py +def test_addition(): + assert 1 + 1 == 2 + +def test_subtraction(): + assert 2 - 1 == 1 + From 289441b9f65e822450776123ae47eed351a41e85 Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 13:12:36 -0400 Subject: [PATCH 02/23] ttt --- .github/workflows/loristest.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/loristest.yml b/.github/workflows/loristest.yml index ac4a84e4e..646a2fdc4 100644 --- a/.github/workflows/loristest.yml +++ b/.github/workflows/loristest.yml @@ -80,4 +80,5 @@ jobs: - name: Build and run Docker Compose run: | - docker compose up --build --exit-code-from pytest + docker compose -f test/docker-compose.yml up --build --exit-code-from pytest + From f5f09fb85ecdf9b3e72686ac51b771d73402e810 Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 13:19:04 -0400 Subject: [PATCH 03/23] test --- .github/workflows/loristest.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/loristest.yml b/.github/workflows/loristest.yml index 646a2fdc4..89c35bb0b 100644 --- a/.github/workflows/loristest.yml +++ b/.github/workflows/loristest.yml @@ -78,6 +78,19 @@ jobs: cd Loris make dev + - name: Run Test Suite + run: | + # set sandbox to 1 before running the tests + # since some tests only run in sandbox environments + sed -i 's/0<\/sandbox>/1<\/sandbox>/g' Loris/test/config.xml + cd Loris + npm run tests:${{ matrix.testsuite }} + env: + # Specifies how many jobs you would like to run in parallel, + CI_NODE_TOTAL: ${{ matrix.ci_node_total }} + # Use the index from matrix as an environment variable + CI_NODE_INDEX: ${{ matrix.ci_node_index }} + - name: Build and run Docker Compose run: | docker compose -f test/docker-compose.yml up --build --exit-code-from pytest From 61d715ff51605db8a546108ea469c06532d34c3a Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 13:35:14 -0400 Subject: [PATCH 04/23] test --- .github/workflows/loristest.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/loristest.yml b/.github/workflows/loristest.yml index 89c35bb0b..1788fe28e 100644 --- a/.github/workflows/loristest.yml +++ b/.github/workflows/loristest.yml @@ -33,6 +33,7 @@ jobs: - name: Override Test Files run: | cp test/Dockerfile.test.php8 Loris/ + cp test/Dockerfile.test.py Loris/ cp test/docker-compose.yml Loris/ cp test/phpunit.xml Loris/test/ cp test/RB_SQL/* Loris/raisinbread/RB_files/ @@ -93,5 +94,5 @@ jobs: - name: Build and run Docker Compose run: | - docker compose -f test/docker-compose.yml up --build --exit-code-from pytest + docker compose up --build --exit-code-from pytest From 5add632f7558a359e81d10854dcec68441046d68 Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 13:43:49 -0400 Subject: [PATCH 05/23] test --- .github/workflows/loristest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/loristest.yml b/.github/workflows/loristest.yml index 1788fe28e..f71b704d2 100644 --- a/.github/workflows/loristest.yml +++ b/.github/workflows/loristest.yml @@ -35,6 +35,7 @@ jobs: cp test/Dockerfile.test.php8 Loris/ cp test/Dockerfile.test.py Loris/ cp test/docker-compose.yml Loris/ + cp test/test_example.py Loris/ cp test/phpunit.xml Loris/test/ cp test/RB_SQL/* Loris/raisinbread/RB_files/ From bed420a54d75754fe91c3ae79baa7731e633951e Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 14:11:41 -0400 Subject: [PATCH 06/23] test --- test_example.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 test_example.py diff --git a/test_example.py b/test_example.py new file mode 100644 index 000000000..b2d513e5a --- /dev/null +++ b/test_example.py @@ -0,0 +1,7 @@ +# tests/test_example.py +def test_addition(): + assert 1 + 1 == 2 + +def test_subtraction(): + assert 2 - 1 == 1 + From 1337dd0b2f4609e50895daa1280a197e7f9bcd67 Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 14:23:13 -0400 Subject: [PATCH 07/23] test --- .github/workflows/loristest.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/loristest.yml b/.github/workflows/loristest.yml index f71b704d2..b973a4cca 100644 --- a/.github/workflows/loristest.yml +++ b/.github/workflows/loristest.yml @@ -93,7 +93,10 @@ jobs: # Use the index from matrix as an environment variable CI_NODE_INDEX: ${{ matrix.ci_node_index }} + - + - name: Build and run Docker Compose run: | - docker compose up --build --exit-code-from pytest + ls -alt + docker compose run -T --rm pytest From 8aebfed294ce31545c5da97bc6fb7d1df86776e4 Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 14:24:10 -0400 Subject: [PATCH 08/23] test --- .github/workflows/loristest.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/loristest.yml b/.github/workflows/loristest.yml index b973a4cca..ed4a9d1f2 100644 --- a/.github/workflows/loristest.yml +++ b/.github/workflows/loristest.yml @@ -93,7 +93,6 @@ jobs: # Use the index from matrix as an environment variable CI_NODE_INDEX: ${{ matrix.ci_node_index }} - - - name: Build and run Docker Compose run: | From ef5f6f5b4501f7ff0fe804ab24c1feb9e95c7192 Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 14:30:01 -0400 Subject: [PATCH 09/23] test --- .github/workflows/loristest.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/loristest.yml b/.github/workflows/loristest.yml index ed4a9d1f2..10d22d72c 100644 --- a/.github/workflows/loristest.yml +++ b/.github/workflows/loristest.yml @@ -96,6 +96,7 @@ jobs: - name: Build and run Docker Compose run: | + cd Loris ls -alt - docker compose run -T --rm pytest + docker compose -f Loris/docker-compose.yml up --build --exit-code-from pytest From 7b5df4c710ed3488a86285f1b44de95e5150a408 Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 14:35:52 -0400 Subject: [PATCH 10/23] test --- .github/workflows/loristest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/loristest.yml b/.github/workflows/loristest.yml index 10d22d72c..fcaa32eb1 100644 --- a/.github/workflows/loristest.yml +++ b/.github/workflows/loristest.yml @@ -98,5 +98,5 @@ jobs: run: | cd Loris ls -alt - docker compose -f Loris/docker-compose.yml up --build --exit-code-from pytest + docker compose -f docker-compose.yml up --build --exit-code-from pytest From adfbd67d8bba07d00d721cbce9b9b3699772695b Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 14:46:53 -0400 Subject: [PATCH 11/23] test --- .github/workflows/loristest.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/loristest.yml b/.github/workflows/loristest.yml index fcaa32eb1..362b71b24 100644 --- a/.github/workflows/loristest.yml +++ b/.github/workflows/loristest.yml @@ -97,6 +97,4 @@ jobs: - name: Build and run Docker Compose run: | cd Loris - ls -alt - docker compose -f docker-compose.yml up --build --exit-code-from pytest - + docker compose run -T --rm pytest pytest From 8f75670e557260417d5e41e849715fcba11fed2b Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 14:54:43 -0400 Subject: [PATCH 12/23] test --- test/Dockerfile.test.py | 5 +---- test/docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/test/Dockerfile.test.py b/test/Dockerfile.test.py index 62b2287bf..e4e0dcdf9 100644 --- a/test/Dockerfile.test.py +++ b/test/Dockerfile.test.py @@ -3,12 +3,9 @@ WORKDIR /app -# Copy test files into the container -COPY test /app/test - # Install pytest RUN pip install pytest # Set the default command to run tests -CMD ["pytest", "/app/test"] +CMD ["pytest"] diff --git a/test/docker-compose.yml b/test/docker-compose.yml index 973f6f14d..9dc761611 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -4,7 +4,7 @@ services: build: context: . dockerfile: Dockerfile.test.py - command: pytest /app/test + command: pytest db: build: From 9822bdc721779c703d8e07037617050294eebde3 Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 15:03:09 -0400 Subject: [PATCH 13/23] test --- test/Dockerfile.test.py | 3 +++ test/docker-compose.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/test/Dockerfile.test.py b/test/Dockerfile.test.py index e4e0dcdf9..a6e002137 100644 --- a/test/Dockerfile.test.py +++ b/test/Dockerfile.test.py @@ -3,6 +3,9 @@ WORKDIR /app +# Copy test files into the container +COPY test /app/test + # Install pytest RUN pip install pytest diff --git a/test/docker-compose.yml b/test/docker-compose.yml index 9dc761611..6e61931e5 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -4,6 +4,9 @@ services: build: context: . dockerfile: Dockerfile.test.py + volumes: + - ./:/app + working_dir: /app/test command: pytest db: From eaa5b2d7631b1e9fafa3bc03d9b84fd941e328e4 Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 15:10:31 -0400 Subject: [PATCH 14/23] test --- test/Dockerfile.test.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/Dockerfile.test.py b/test/Dockerfile.test.py index a6e002137..8ee9d5fc4 100644 --- a/test/Dockerfile.test.py +++ b/test/Dockerfile.test.py @@ -1,11 +1,19 @@ # Dockerfile FROM python:3.11.3-slim + WORKDIR /app # Copy test files into the container COPY test /app/test +RUN echo "Working directory:" +RUN pwd +RUN echo "Directory contents:" +RUN ls -R + + + # Install pytest RUN pip install pytest From 512425b8c80c9d68a1156813c7b7f6bf7d5d232c Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 15:22:40 -0400 Subject: [PATCH 15/23] test --- test/Dockerfile.test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Dockerfile.test.py b/test/Dockerfile.test.py index 8ee9d5fc4..3b57dbffb 100644 --- a/test/Dockerfile.test.py +++ b/test/Dockerfile.test.py @@ -5,7 +5,7 @@ WORKDIR /app # Copy test files into the container -COPY test /app/test +COPY . /app/test RUN echo "Working directory:" RUN pwd From b55a4cb273c8b667b31044753d4ec6e771fb9c28 Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 15:28:38 -0400 Subject: [PATCH 16/23] test --- test/Dockerfile.test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Dockerfile.test.py b/test/Dockerfile.test.py index 3b57dbffb..b1d554d62 100644 --- a/test/Dockerfile.test.py +++ b/test/Dockerfile.test.py @@ -11,7 +11,7 @@ RUN pwd RUN echo "Directory contents:" RUN ls -R - +RUN cd test # Install pytest From 6340cabdffbc262a8dc7ce52ed87ee800adb0b32 Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 15:35:43 -0400 Subject: [PATCH 17/23] test --- test/Dockerfile.test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Dockerfile.test.py b/test/Dockerfile.test.py index b1d554d62..c2af64563 100644 --- a/test/Dockerfile.test.py +++ b/test/Dockerfile.test.py @@ -18,5 +18,5 @@ RUN pip install pytest # Set the default command to run tests -CMD ["pytest"] +CMD ["pytest","/app/test"] From c1948cf7b85f766b6852eddedbba79eef040d5a6 Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 15:43:14 -0400 Subject: [PATCH 18/23] test --- .github/workflows/loristest.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/loristest.yml b/.github/workflows/loristest.yml index 362b71b24..d80e7ae74 100644 --- a/.github/workflows/loristest.yml +++ b/.github/workflows/loristest.yml @@ -36,6 +36,8 @@ jobs: cp test/Dockerfile.test.py Loris/ cp test/docker-compose.yml Loris/ cp test/test_example.py Loris/ + cp test/test_example.py Loris/test + cp test/test_example.py . cp test/phpunit.xml Loris/test/ cp test/RB_SQL/* Loris/raisinbread/RB_files/ From ff3c43ef4990dfc0cd198ff55986530c65023ac7 Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Fri, 30 Aug 2024 16:01:28 -0400 Subject: [PATCH 19/23] test --- .github/workflows/loristest.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/loristest.yml b/.github/workflows/loristest.yml index d80e7ae74..87c0cfb93 100644 --- a/.github/workflows/loristest.yml +++ b/.github/workflows/loristest.yml @@ -35,9 +35,7 @@ jobs: cp test/Dockerfile.test.php8 Loris/ cp test/Dockerfile.test.py Loris/ cp test/docker-compose.yml Loris/ - cp test/test_example.py Loris/ cp test/test_example.py Loris/test - cp test/test_example.py . cp test/phpunit.xml Loris/test/ cp test/RB_SQL/* Loris/raisinbread/RB_files/ From 3cec2110930cc072323025b4e13a90a3bea8d40a Mon Sep 17 00:00:00 2001 From: Shen Date: Tue, 3 Sep 2024 12:53:13 -0400 Subject: [PATCH 20/23] Delete test_example.py --- test_example.py | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 test_example.py diff --git a/test_example.py b/test_example.py deleted file mode 100644 index b2d513e5a..000000000 --- a/test_example.py +++ /dev/null @@ -1,7 +0,0 @@ -# tests/test_example.py -def test_addition(): - assert 1 + 1 == 2 - -def test_subtraction(): - assert 2 - 1 == 1 - From 0cb142a41c89ac5a8e4eff83a746544ae286743d Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Wed, 4 Sep 2024 10:06:15 -0400 Subject: [PATCH 21/23] rename --- test/Dockerfile.test.python | 22 ++++++++++++++++++++++ test/docker-compose.yml | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 test/Dockerfile.test.python diff --git a/test/Dockerfile.test.python b/test/Dockerfile.test.python new file mode 100644 index 000000000..c2af64563 --- /dev/null +++ b/test/Dockerfile.test.python @@ -0,0 +1,22 @@ +# Dockerfile +FROM python:3.11.3-slim + + +WORKDIR /app + +# Copy test files into the container +COPY . /app/test + +RUN echo "Working directory:" +RUN pwd +RUN echo "Directory contents:" +RUN ls -R +RUN cd test + + +# Install pytest +RUN pip install pytest + +# Set the default command to run tests +CMD ["pytest","/app/test"] + diff --git a/test/docker-compose.yml b/test/docker-compose.yml index 6e61931e5..81c422e4f 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -3,7 +3,7 @@ services: pytest: build: context: . - dockerfile: Dockerfile.test.py + dockerfile: Dockerfile.test.python volumes: - ./:/app working_dir: /app/test From d0ee03c1937d6bf5875aee832a0d8f750a9d0002 Mon Sep 17 00:00:00 2001 From: kongtiaowang Date: Wed, 4 Sep 2024 10:13:28 -0400 Subject: [PATCH 22/23] done --- .github/workflows/loristest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/loristest.yml b/.github/workflows/loristest.yml index 87c0cfb93..5270813a8 100644 --- a/.github/workflows/loristest.yml +++ b/.github/workflows/loristest.yml @@ -33,7 +33,7 @@ jobs: - name: Override Test Files run: | cp test/Dockerfile.test.php8 Loris/ - cp test/Dockerfile.test.py Loris/ + cp test/Dockerfile.test.python Loris/ cp test/docker-compose.yml Loris/ cp test/test_example.py Loris/test cp test/phpunit.xml Loris/test/ From 015e87bf0baa00a22b163ff914abd17f59cbf2e3 Mon Sep 17 00:00:00 2001 From: Shen Date: Fri, 13 Sep 2024 10:11:18 -0400 Subject: [PATCH 23/23] Delete test/Dockerfile.test.py --- test/Dockerfile.test.py | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 test/Dockerfile.test.py diff --git a/test/Dockerfile.test.py b/test/Dockerfile.test.py deleted file mode 100644 index c2af64563..000000000 --- a/test/Dockerfile.test.py +++ /dev/null @@ -1,22 +0,0 @@ -# Dockerfile -FROM python:3.11.3-slim - - -WORKDIR /app - -# Copy test files into the container -COPY . /app/test - -RUN echo "Working directory:" -RUN pwd -RUN echo "Directory contents:" -RUN ls -R -RUN cd test - - -# Install pytest -RUN pip install pytest - -# Set the default command to run tests -CMD ["pytest","/app/test"] -