From ba14c5c6d4dec59bba3f3e79af0781c90e81e87d Mon Sep 17 00:00:00 2001 From: Patrick Devaney Date: Fri, 3 Jan 2025 16:22:48 -0500 Subject: [PATCH] [CLEANUP] --- .github/workflows/docker-test.yml | 7 +++---- tests/Dockerfile | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index f210bd45..9dbe9b42 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -36,7 +36,6 @@ jobs: - name: Build Docker image id: build_image run: | - docker build -t test-runner:swarm-testing ./tests IMAGE_TAG="test-runner:swarm-testing-${GITHUB_SHA}" docker build -t $IMAGE_TAG . echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV @@ -47,8 +46,8 @@ jobs: mkdir -p ${{ github.workspace }}/logs chmod -R 777 ${{ github.workspace }}/logs - # Run Docker container with OpenAI API Key and capture test logs - - name: Run Docker container with OpenAI API Key and tests + # Run Docker container with OpenAI API Key securely and capture test logs + - name: Run Docker container with OpenAI API Key run: | docker run -e OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} \ -v ${{ github.workspace }}/logs:/usr/src/app/logs \ @@ -58,4 +57,4 @@ jobs: # Print the test logs to the console - name: Print test logs run: | - cat ${{ github.workspace }}/logs/test_logs.txt || echo "No test logs found" + cat ${{ github.workspace }}/logs/test_logs.txt || echo "No test logs found" \ No newline at end of file diff --git a/tests/Dockerfile b/tests/Dockerfile index a10e0734..fc7ed9c7 100644 --- a/tests/Dockerfile +++ b/tests/Dockerfile @@ -8,10 +8,10 @@ ENV PYTHONDONTWRITEBYTECODE=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ PIP_DEFAULT_TIMEOUT=100 -# Set the working directory to the root of the project +# Set the working directory to the root of the project (relative to pyproject.toml) WORKDIR /usr/src/app -# Copy the entire project into the container (including pyproject.toml) +# Copy the entire project into the container COPY . . # Install Poetry @@ -36,4 +36,4 @@ ENV PATH="/usr/local/bin:$PATH" WORKDIR /usr/src/app/tests # Default command to run tests located in the /tests directory -CMD pytest /usr/src/app/tests --continue-on-collection-errors --tb=short --disable-warnings | tee /usr/src/app/logs/test_logs.txt +CMD pytest /usr/src/app/tests --continue-on-collection-errors --tb=short --disable-warnings | tee /usr/src/app/logs/test_logs.txt \ No newline at end of file