Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
node-version: [14.18, 16.13, 18]
node-version: [16.13, 18, 24]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Docker login
Expand All @@ -33,7 +33,7 @@ jobs:
- run: npm test
- run: npm run generate-coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: ./coverage.lcov
flags: unittests
Expand All @@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: npx @adobe/sizewatcher
env:
GITHUB_TOKEN: ${{ secrets.ADOBE_BOT_GITHUB_TOKEN }}
Expand All @@ -54,13 +54,13 @@ jobs:
needs: [build]
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') && github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Node.js 16
uses: actions/setup-node@v3
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: '16.13'
node-version: '18'
- run: npm install
- run: npm run semantic-release
env:
Expand Down
3 changes: 2 additions & 1 deletion src/lib/actionrunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ const OPENWHISK_DEFAULTS = {
// "nodejs:8" : "openwhisk/action-nodejs-v8:latest",
// "nodejs:10" : "adobeapiplatform/adobe-action-nodejs-v10:3.0.27", // see: https://hub.docker.com/r/adobeapiplatform/adobe-action-nodejs-v10/tags
// "nodejs:12" : removed - Node.js 12 is end-of-life and incompatible with modern dependencies
"nodejs:14" : "adobeapiplatform/adobe-action-nodejs-v14:3.0.43", // see: https://hub.docker.com/r/adobeapiplatform/adobe-action-nodejs-v14/tags
// "nodejs:14" : removed - Node.js 14 is end-of-life and incompatible with modern dependencies
"nodejs:16" : "adobeapiplatform/adobe-action-nodejs-v16:3.0.43", // see: https://hub.docker.com/r/adobeapiplatform/adobe-action-nodejs-v16/tags
"nodejs:24" : "adobeapiplatform/adobe-action-nodejs-v24:3.0.44", // see: https://hub.docker.com/r/adobeapiplatform/adobe-action-nodejs-v24/tags
// "python" : "openwhisk/python2action:latest",
// "python:2" : "openwhisk/python2action:latest",
// "python:3" : "openwhisk/python3action:latest",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ packages:
actions:
worker:
function: 'worker.js'
runtime: 'nodejs:14'
runtime: 'nodejs:24'
web: true
annotations:
require-adobe-auth: true
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "worker",
"version": "1.0.0",
"dependencies": {
"@adobe/asset-compute-sdk": "^2.10.6"
"@adobe/asset-compute-sdk": "^4.6.2"
},
"private": true
}
File renamed without changes.
2 changes: 1 addition & 1 deletion test/commands/devtool.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe("devtool command", function() {
await fetch(url);
assert.fail('Should have failed');
} catch (error) {
assert.ok(error.message.includes('ECONNREFUSED')); // should fail because server is no longer running
assert.ok(error.message.includes('ECONNREFUSED') || error.code === 'ECONNREFUSED');
}

});
Expand Down
6 changes: 4 additions & 2 deletions test/commands/test-worker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,10 @@ describe("test-worker command", function() {
});

// nodejs:12 test removed - Node.js 12 is end-of-life and incompatible with modern dependencies
testCommand("test-projects/node14", "asset-compute:test-worker")
.it("runs tests in a project using kind nodejs:14", function(ctx) {
// nodejs:14 test removed - Node.js 14 is end-of-life and incompatible with modern dependencies

testCommand("test-projects/node24", "asset-compute:test-worker")
.it("runs tests in a project using kind nodejs:24", function(ctx) {
assertExitCode(undefined);
assert(ctx.stdout.includes(" - simple"));
assert(ctx.stdout.includes("✔ Succeeded."));
Expand Down
6 changes: 4 additions & 2 deletions test/commands/testutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ function testCommand(dir, command, args=[]) {
})
.finally(ctx => {
// reset any exit code set by failing tests
delete process.exitCode;
// Note: `delete process.exitCode` does not work in Node.js 24+,
// must assign undefined instead
process.exitCode = undefined;

delete process.env.AIO_ASSET_COMPUTE_LOG_DELAY;

Expand Down Expand Up @@ -144,4 +146,4 @@ module.exports = {
assertExitCode,
assertOccurrences,
assertMissingOrEmptyDirectory
};
};
31 changes: 29 additions & 2 deletions test/lib/actionrunner.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe("actionrunner tests", function() {
}
}
});
const containerHost = '0.0.0.0:2435\n::::2345';
const containerHost = '0.0.0.0:2435';
nock(`http://${containerHost}`).post("/init").reply(400);

// mock docker to avoid errors with trying to get logs
Expand All @@ -48,8 +48,35 @@ describe("actionrunner tests", function() {
actionRunner.containerHost = containerHost;
try {
await actionRunner._initAction();
assert.fail('should have thrown');
} catch (error) {
assert.strictEqual(error.message, 'Could not init action on container (POST http://0.0.0.0:2435\n::::2345/init: responded with error: 400');
assert.ok(error.message.includes('Could not init action on container'));
assert.ok(error.message.includes('/init'));
assert.ok(error.message.includes('400'));
}
});
it("failure during action initalization with nodejs:24 kind, body is empty", async function() {
const actionRunner = new OpenwhiskActionRunner({
action: {
exec: {
kind: 'nodejs:24',
binary: true,
code: '2435'
}
}
});
const containerHost = '0.0.0.0:2435';
nock(`http://${containerHost}`).post("/init").reply(400);

actionRunner._docker = () => {};
actionRunner.containerHost = containerHost;
try {
await actionRunner._initAction();
assert.fail('should have thrown');
} catch (error) {
assert.ok(error.message.includes('Could not init action on container'));
assert.ok(error.message.includes('/init'));
assert.ok(error.message.includes('400'));
}
});

Expand Down