Skip to content

Commit 475cdf9

Browse files
author
Guy Bedford
authored
feat: use StarlingMonkey by default, --disable-starlingmonkey flag (#861)
1 parent 7d11ae7 commit 475cdf9

File tree

13 files changed

+26
-27
lines changed

13 files changed

+26
-27
lines changed

.github/actions/compute-sdk-test/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ runs:
3131
shell: bash
3232
- run: cd ./integration-tests/js-compute && yarn
3333
shell: bash
34-
- run: cd ./integration-tests/js-compute && ./test.js --local
34+
- run: cd ./integration-tests/js-compute && ./test.js --disable-starlingmonkey --local
3535
shell: bash

.github/actions/e2e/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ runs:
3434
shell: bash
3535
- run: cd ./integration-tests/js-compute && yarn
3636
shell: bash
37-
- run: cd ./integration-tests/js-compute && ./test.js
37+
- run: cd ./integration-tests/js-compute && ./test.js --disable-starlingmonkey
3838
shell: bash
3939
env: # Or as an environment variable
4040
FASTLY_API_TOKEN: ${{ inputs.fastly-api-token }}

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ jobs:
207207

208208
- name: Build WPT runtime
209209
run: |
210-
bash ./tests/wpt-harness/build-wpt-runtime.sh
210+
bash ./tests/wpt-harness/build-wpt-runtime.sh --disable-starlingmonkey
211211
212212
- name: Prepare WPT hosts
213213
run: |
@@ -427,7 +427,7 @@ jobs:
427427
- run: yarn install --frozen-lockfile
428428

429429
- name: Build WPT runtime
430-
run: tests/wpt-harness/build-wpt-runtime.sh --starlingmonkey
430+
run: tests/wpt-harness/build-wpt-runtime.sh
431431

432432
- name: Prepare WPT hosts
433433
run: |
@@ -491,6 +491,6 @@ jobs:
491491
- name: Yarn install
492492
run: yarn && cd ./integration-tests/js-compute && yarn
493493

494-
- run: node integration-tests/js-compute/test.js --starlingmonkey ${{ matrix.platform == 'viceroy' && '--local' || '' }}
494+
- run: node integration-tests/js-compute/test.js ${{ matrix.platform == 'viceroy' && '--local' || '' }}
495495
env:
496496
FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}

integration-tests/cli/starlingmonkey.test.js renamed to integration-tests/cli/disable-starlingmonkey.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ test('should create wasm file and return zero exit code for StarlingMonkey', asy
1414

1515
t.is(await exists('./bin/main.wasm'), false)
1616

17-
const { code, stdout, stderr } = await execute(process.execPath, cli + ' --starlingmonkey');
17+
const { code, stdout, stderr } = await execute(process.execPath, cli + ' --disable-starlingmonkey');
1818

1919
t.is(await exists('./bin/main.wasm'), true)
20-
t.alike(stdout, ['Building with the experimental StarlingMonkey engine']);
20+
t.alike(stdout, ['Building with the js-compute-runtime.wasm engine']);
2121
t.alike(stderr, []);
2222
t.is(code, 0);
2323
});

integration-tests/js-compute/fixtures/app/setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { $ as zx } from 'zx'
44
import { argv } from 'node:process'
55

66
const serviceName = argv[2]
7-
const starlingmonkey = argv.slice(2).includes('--starlingmonkey');
7+
const starlingmonkey = !argv.slice(2).includes('--disable-starlingmonkey');
88

99
const startTime = Date.now();
1010

integration-tests/js-compute/fixtures/app/src/kv-store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { KVStore } from "fastly:kv-store";
44
import { sdkVersion } from "fastly:experimental";
55
import { routes, isRunningLocally } from "./routes.js";
66

7-
const starlingmonkey = sdkVersion.includes('starlingmonkey');
7+
const starlingmonkey = !sdkVersion.includes('legacy');
88

99
// KVStore
1010
{

integration-tests/js-compute/test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async function sleep(seconds) {
3535
let args = argv.slice(2);
3636

3737
const local = args.includes('--local');
38-
const starlingmonkey = args.includes('--starlingmonkey');
38+
const starlingmonkey = !args.includes('--disable-starlingmonkey');
3939
const filter = args.filter(arg => !arg.startsWith('--'));
4040

4141
async function $(...args) {
@@ -67,9 +67,9 @@ await cd(fixturePath);
6767
await copyFile(join(fixturePath, 'fastly.toml.in'), join(fixturePath, 'fastly.toml'))
6868
const config = TOML.parse(await readFile(join(fixturePath, 'fastly.toml'), 'utf-8'))
6969
config.name = serviceName;
70-
if (starlingmonkey) {
70+
if (!starlingmonkey) {
7171
const buildArgs = config.scripts.build.split(' ')
72-
buildArgs.splice(-1, null, '--starlingmonkey')
72+
buildArgs.splice(-1, null, '--disable-starlingmonkey')
7373
config.scripts.build = buildArgs.join(' ')
7474
}
7575
await writeFile(join(fixturePath, 'fastly.toml'), TOML.stringify(config), 'utf-8')
@@ -91,7 +91,7 @@ if (!local) {
9191
const setupPath = join(fixturePath, 'setup.js')
9292
if (existsSync(setupPath)) {
9393
core.startGroup('Extra set-up steps for the service')
94-
await zx`node ${setupPath} ${serviceName} ${starlingmonkey ? '--starlingmonkey' : ''}`
94+
await zx`node ${setupPath} ${serviceName} ${starlingmonkey ? '' : '--disable-starlingmonkey'}`
9595
await sleep(60)
9696
core.endGroup()
9797
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"scripts": {
2929
"test": "npm run test:types && npm run test:cli",
3030
"test:cli": "brittle --bail integration-tests/cli/**.test.js",
31-
"test:integration": "node ./integration-tests/js-compute/test.js",
31+
"test:integration": "node ./integration-tests/js-compute/test.js --disable-starlingmonkey",
3232
"test:wpt": "tests/wpt-harness/build-wpt-runtime.sh && node ./tests/wpt-harness/run-wpt.mjs -vv",
3333
"test:types": "tsd",
3434
"build": "make -j8 -C runtime/js-compute-runtime && cp runtime/js-compute-runtime/js-compute-runtime.wasm .",

runtime/StarlingMonkey

Submodule StarlingMonkey updated 113 files

runtime/fastly/build-debug.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
cd "$(dirname "$0")" || exit 1
33
RUNTIME_VERSION=$(npm pkg get version --json --prefix=../../ | jq -r)
4-
HOST_API=$(realpath host-api) cmake -B build-debug -DCMAKE_BUILD_TYPE=Debug -DENABLE_BUILTIN_WEB_FETCH=0 -DENABLE_BUILTIN_WEB_FETCH_FETCH_EVENT=0 -DRUNTIME_VERSION="\"starlingmonkey-$RUNTIME_VERSION\""
4+
HOST_API=$(realpath host-api) cmake -B build-debug -DCMAKE_BUILD_TYPE=Debug -DENABLE_BUILTIN_WEB_FETCH=0 -DENABLE_BUILTIN_WEB_FETCH_FETCH_EVENT=0 -DRUNTIME_VERSION="\"$RUNTIME_VERSION-debug\""
55
cmake --build build-debug --parallel 10
66
mv build-debug/starling.wasm/starling.wasm ../../

0 commit comments

Comments
 (0)