Skip to content

Commit

Permalink
fix: update code
Browse files Browse the repository at this point in the history
Signed-off-by: Junjie Gao <[email protected]>
  • Loading branch information
JeyJeyGao committed Nov 24, 2023
1 parent f7b5e11 commit c733071
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
21 changes: 21 additions & 0 deletions .github/e2e/download-server/dockerfile.windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Use Windows Nano Server image as the base image
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022

# Download the Python installer
ADD https://www.python.org/ftp/python/3.8.0/python-3.8.0.exe C:\\temp\\python-installer.exe

# Install Python
RUN C:\\temp\\python-installer.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0 && \
del C:\\temp\\python-installer.exe

# Set the working directory in the container
WORKDIR /app

# Copy the Python script into the container at the working directory
COPY download-server.py ./

# Make port 8000 available to the world outside this container
EXPOSE 8000

# Command to run e2e-server.py when the container launches
CMD ["python", ".\download-server.py"]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# this script is used to serve the e2e test artifacts server locally for
# downloading the artifacts in the e2e tests
# this script is used to serve the artifacts server locally for
# downloading the artifacts
import http.server
import socketserver

Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ jobs:
with:
name: linux-amd64-binary
path: ./bin/artifacts
- run: tree ./bin/artifacts
- uses: JarvusInnovations/background-action@v1
name: Bootstrap System Under Test (SUT)
with:
run: python3 ./.github/e2e/e2e-server.py
- name: Run download server locally
run: |
# start the server
nohup python3 ./.github/e2e/e2e-server.py &
# prepare the environment variables for E2E
artifactName=notation-azure-kv_0.0.1_linux_amd64.tar.gz
checksum=$(shasum -a 256 "./bin/artifacts/$artifactName" | awk '{print $1}')
Expand Down Expand Up @@ -133,11 +133,12 @@ jobs:
with:
name: win-amd64-binary
path: ./bin/artifacts
- uses: JarvusInnovations/background-action@v1
name: Bootstrap System Under Test (SUT)
with:
run: python3 .\.github\e2e\download-server\download-server.py
- name: Run download server locally
run: |
# Start the server
Start-Process -NoNewWindow -FilePath "python3" -ArgumentList ".\.github\e2e\e2e-server.py"
# Prepare the environment variables for E2E
$artifactName = "notation-azure-kv_0.0.1_windows_amd64.zip"
$checksum = (Get-FileHash ".\bin\artifacts\$artifactName" -Algorithm SHA256).Hash
Expand Down

0 comments on commit c733071

Please sign in to comment.