Skip to content

Commit

Permalink
Removing storage dependency for the tests (#1199)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekjilla authored Feb 2, 2025
1 parent 6f896ab commit 0d287bc
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 32 deletions.
Binary file not shown.
Binary file added test/dotnet-functions.zip
Binary file not shown.
Binary file added test/dotnet-isolated-functions.zip
Binary file not shown.
Binary file added test/dotnet-isolated6-functions.zip
Binary file not shown.
Binary file added test/dotnet-isolated7-functions.zip
Binary file not shown.
Binary file added test/dotnet-isolated8-functions.zip
Binary file not shown.
Binary file added test/dotnet8-inproc.zip
Binary file not shown.
27 changes: 12 additions & 15 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,68 +8,65 @@ if (process.argv.length < 2) {
process.exit(1);
}

const storagePath =
"https://functionsdockertests.blob.core.windows.net/public/docker";

const dotnetIsolated5 = {
package: `${storagePath}/dotnet-isolated-functions.zip`,
package: `dotnet-isolated-functions.zip`,
invoke: "/api/DotnetIsolatedHttpFunction",
response: "Hello, Test"
}

const dotnetIsolated6 = {
package: `${storagePath}/dotnet-isolated6-functions.zip`,
package: `dotnet-isolated6-functions.zip`,
invoke: "/api/DotnetIsolatedHttpFunction",
response: "Hello, Test"
}

const dotnetIsolated7 = {
package: `${storagePath}/dotnet-isolated7-functions.zip`,
package: `dotnet-isolated7-functions.zip`,
invoke: "/api/DotnetIsolated7HttpFunction",
response: "Welcome to Azure Functions! .NET 7 Preview 5"
}

const dotnetIsolated8 = {
package: `${storagePath}/dotnet-isolated8-functions.zip`,
package: `dotnet-isolated8-functions.zip`,
invoke: "/api/DotnetIsolated8HttpFunction",
response: "Welcome to Azure Functions! .NET 8"
}

const dotnetIsolated9 = {
package: `${storagePath}/Net9HttpApp_Isolated_Portable_20240719_1554.zip`,
package: `Net9HttpApp_Isolated_Portable_20240719_1554.zip`,
invoke: "/api/hellohttp",
response: "Welcome to Azure Functions! .NET 9"
}

const dotnetInProc8 = {
package: `${storagePath}/dotnet8-inproc.zip`,
package: `dotnet8-inproc.zip`,
invoke: "/api/CSharpHttpFunction?name=Test",
response: "Hello, Test. This HTTP triggered function executed successfully."
}

const map = {
python: {
package: `${storagePath}/python-functions.zip`,
package: `python-functions.zip`,
invoke: "/api/PythonHttpTrigger?name=Test",
response: "Hello Test!"
},
powershell: {
package: `${storagePath}/powershell-functions.zip`,
package: `powershell-functions.zip`,
invoke: "/api/PowershellHttpTrigger?name=Test",
response: "Hello Test"
},
node: {
package: `${storagePath}/node-functions.zip`,
package: `node-functions.zip`,
invoke: "/api/JsHttpTrigger?name=Test",
response: "Hello Test"
},
dotnet: {
package: `${storagePath}/dotnet-functions.zip`,
package: `dotnet-functions.zip`,
invoke: "/api/CSharpHttpFunction?name=Test",
response: "Hello, Test"
},
java: {
package: `${storagePath}/java-functions.zip`,
package: `java-functions.zip`,
invoke: "/api/HttpTrigger-Java?name=Test",
response: "Hello, Test"
}
Expand Down Expand Up @@ -125,7 +122,7 @@ const name = random();
const runTest = async (data: typeof map.dotnet, envStr = "") => {
if (
shell.exec(
`docker build -t ${name} --build-arg BASE_IMAGE=${imageName} --build-arg CONTENT_URL=${data.package} -f ${dockerFile} ${__dirname}`
`docker build -t ${name} --build-arg BASE_IMAGE=${imageName} --build-arg CONTENT_PKG=${data.package} -f ${dockerFile} ${__dirname}`
).code !== 0
) {
console.error("Error building image");
Expand Down
Binary file added test/java-functions.zip
Binary file not shown.
Binary file added test/node-functions.zip
Binary file not shown.
Binary file added test/powershell-functions.zip
Binary file not shown.
Binary file added test/python-functions.zip
Binary file not shown.
6 changes: 3 additions & 3 deletions test/test-alpine.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ARG BASE_IMAGE
ARG CONTENT_URL
ARG CONTENT_PKG
FROM ${BASE_IMAGE}

ARG CONTENT_URL
ARG CONTENT_PKG

ENV AzureFunctionsJobHost__Logging__Console__IsEnabled=true
COPY ${CONTENT_PKG} content.zip

RUN apk update && apk add --no-cache zip unzip curl && \
curl -o content.zip "${CONTENT_URL}" && \
mkdir -p /home/site/wwwroot && \
yes | unzip -q content.zip -d /home/site/wwwroot
9 changes: 5 additions & 4 deletions test/test-azurelinux.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
ARG BASE_IMAGE
ARG CONTENT_URL
ARG CONTENT_PKG
FROM ${BASE_IMAGE}

ARG CONTENT_URL
ARG CONTENT_PKG

ENV AzureFunctionsJobHost__Logging__Console__IsEnabled=true

RUN curl -O https://packages.microsoft.com/azurelinux/3.0/prod/base/x86_64/Packages/u/unzip-6.0-21.azl3.x86_64.rpm
RUN tdnf install -y unzip-6.0-21.azl3.x86_64.rpm

RUN curl -o content.zip "${CONTENT_URL}" && \
mkdir -p /home/site/wwwroot && \
COPY ${CONTENT_PKG} content.zip

RUN mkdir -p /home/site/wwwroot && \
yes | unzip -q content.zip -d /home/site/wwwroot
7 changes: 4 additions & 3 deletions test/test-mariner.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
ARG BASE_IMAGE
ARG CONTENT_URL
ARG CONTENT_PKG
FROM ${BASE_IMAGE}

ARG CONTENT_URL
ARG CONTENT_PKG

ENV AzureFunctionsJobHost__Logging__Console__IsEnabled=true

COPY ${CONTENT_PKG} content.zip

RUN yum install -y dnf && \
dnf install -y zip unzip curl && \
curl -o content.zip "${CONTENT_URL}" && \
mkdir -p /home/site/wwwroot && \
yes | unzip -q content.zip -d /home/site/wwwroot
9 changes: 5 additions & 4 deletions test/test-win.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# escape=`

ARG BASE_IMAGE
ARG CONTENT_URL
ARG CONTENT_PKG
FROM mcr.microsoft.com/windows/servercore:ltsc2019 as tools-env
ARG CONTENT_URL
ARG CONTENT_PKG

COPY ${CONTENT_PKG} dotnet.zip

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

RUN Invoke-WebRequest -OutFile dotnet.zip "$Env:CONTENT_URL"; `
Expand-Archive dotnet.zip -DestinationPath C:\approot
RUN Expand-Archive dotnet.zip -DestinationPath C:\approot

FROM ${BASE_IMAGE}

Expand Down
7 changes: 4 additions & 3 deletions test/test.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
ARG BASE_IMAGE
ARG CONTENT_URL
ARG CONTENT_PKG
FROM ${BASE_IMAGE}

ARG CONTENT_URL
ARG CONTENT_PKG

ENV AzureFunctionsJobHost__Logging__Console__IsEnabled=true

COPY ${CONTENT_PKG} content.zip

RUN apt-get update && \
apt-get install -y zip unzip curl && \
curl -o content.zip "${CONTENT_URL}" && \
mkdir -p /home/site/wwwroot && \
yes | unzip -q content.zip -d /home/site/wwwroot

0 comments on commit 0d287bc

Please sign in to comment.