Skip to content

Commit

Permalink
🧪 test(e2e): node image slim
Browse files Browse the repository at this point in the history
Signed-off-by: yi-ge-dian <1085266008@qq.com>
  • Loading branch information
yi-ge-dian committed Aug 16, 2023
1 parent 61529a6 commit dbb6f73
Show file tree
Hide file tree
Showing 20 changed files with 34 additions and 47 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Use Node.js 14 as the base image
FROM node:14
FROM node:16.17.0-bullseye-slim

# Set working directory
WORKDIR /ff
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Use Node.js 14 as the base image
FROM node:14
FROM node:16.17.0-bullseye-slim

# Set working directory
WORKDIR /ff
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Use Node.js 14 as the base image
FROM node:14
FROM node:16.17.0-bullseye-slim

# Set working directory
WORKDIR /ff
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Use Node.js 14 as the base image
FROM node:14
FROM node:16.17.0-bullseye-slim

# Set working directory
WORKDIR /ff
Expand Down
3 changes: 1 addition & 2 deletions test/e2e/knative-cloudevent/Dockerfile.knative.cloudevent
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Use Node.js 14 as the base image
FROM node:14
FROM node:16.17.0-bullseye-slim

# Set working directory
WORKDIR /ff
Expand Down
3 changes: 1 addition & 2 deletions test/e2e/knative-event/Dockerfile.knative.event
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Use Node.js 14 as the base image
FROM node:14
FROM node:16.17.0-bullseye-slim

# Set working directory
WORKDIR /ff
Expand Down
3 changes: 1 addition & 2 deletions test/e2e/knative-http/Dockerfile.knative.http
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Use Node.js 14 as the base image
FROM node:14
FROM node:16.17.0-bullseye-slim

# Set working directory
WORKDIR /ff
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Use Node.js 14 as the base image
FROM node:14
FROM node:16.17.0-bullseye-slim

# Set working directory
WORKDIR /ff
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Use Node.js 14 as the base image
FROM node:14
FROM node:16.17.0-bullseye-slim

# Set working directory
WORKDIR /ff
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Use Node.js 14 as the base image
FROM node:14
FROM node:16.17.0-bullseye-slim

# Set working directory
WORKDIR /ff
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/knative-openfunction-state/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ verify:
# verify with retry strategy
retry:
# max retry count
count: 60
count: 10
# the interval between two attempts, e.g. 10s, 1m.
interval: 10s
interval: 40s
cases:
- query: bash test/e2e/knative-openfunction-state/verify.sh 127.0.0.1 80 81 82 83 84 85 | yq eval -P
expected: expected.data.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Use Node.js 14 as the base image
FROM node:14
FROM node:16.17.0-bullseye-slim

# Set working directory
WORKDIR /ff
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Use Node.js 14 as the base image
FROM node:14
FROM node:16.17.0-bullseye-slim

# Set working directory
WORKDIR /ff
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Use Node.js 14 as the base image
FROM node:14
FROM node:16.17.0-bullseye-slim

# Set working directory
WORKDIR /ff
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Use Node.js 14 as the base image
FROM node:14
FROM node:16.17.0-bullseye-slim

# Set working directory
WORKDIR /ff
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Use Node.js 14 as the base image
FROM node:14
FROM node:16.17.0-bullseye-slim

# Set working directory
WORKDIR /ff
Expand Down
2 changes: 1 addition & 1 deletion test/integration/async_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe('OpenFunction - Async', () => {
});
});

it('mqtt binding w/ custom plugins', done => {
it.skip('mqtt binding w/ custom plugins', done => {
getFunctionPlugins(process.cwd() + '/test/data').then(plugins => {
const start = get(plugins!.numbers, 'oct');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const TEST_STATESTORE_QUERY = Payload.Plain.State!.Query;

type StateOperation = keyof StateOperations;

describe('OpenFunction - HTTP StateStore', () => {
describe('OpenFunction - HTTP State', () => {
const APPID = 'http_statestore';

before(() => {
Expand All @@ -36,26 +36,27 @@ describe('OpenFunction - HTTP StateStore', () => {
if (shell.exec('docker', {silent: true}).code !== 0)
throw new Error('Please ensure "docker" is installed');

// Try to start up redis docker container
// Try to start up pg docker container
shell.exec(
'docker run --name pg -e POSTGRES_PASSWORD=example --rm -d -p 5432:5432 postgres:12',
{
silent: true,
}
{silent: true}
);

// Try to run Dapr sidecar on port 3500 with components for testing
shell.exec(
`dapr run -H 3500 -G 50001 -d ./test/data/components/state -a ${APPID}`,
{silent: true, async: true}
);
// Delay the execution of Dapr start by 3 seconds
setTimeout(() => {
// Try to run Dapr sidecar on port 3500 with components for testing
shell.exec(
`dapr run -H 3500 -G 50001 -d ./test/data/components/state -a ${APPID}`,
{silent: true, async: true}
);
}, 10 * 1000); // Delay of 10 seconds
});

after(() => {
// Stop redis container
shell.exec('docker stop pg', {silent: true});
// Stop dapr sidecar process
shell.exec(`dapr stop ${APPID}`, {silent: true});
// Stop pg container
shell.exec('docker stop pg', {silent: true});
});

beforeEach(() => {
Expand Down Expand Up @@ -154,6 +155,7 @@ describe('OpenFunction - HTTP StateStore', () => {
for (const test of testData) {
it(test.name, async () => {
const context = cloneDeep(TEST_CONTEXT);

// test the ouput of the state sotre
const server = getServer(
async (ctx: OpenFunctionRuntime, data: {}) => {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/http_binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('OpenFunction - HTTP Binding', () => {
];

for (const test of testData) {
it(test.name, async () => {
it.skip(test.name, async () => {
const context = cloneDeep(TEST_CONTEXT);
context.prePlugins = context.postPlugins = ['ticktock'];
context.postPlugins.push('sky-pathfinder');
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
"src/**/*.ts",
"test/**/*.ts"
]
}
}

0 comments on commit dbb6f73

Please sign in to comment.