From 3ff80119e651617512a85a49cc53ee9fb6ee2f3a Mon Sep 17 00:00:00 2001 From: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com> Date: Tue, 20 May 2025 22:48:18 +0100 Subject: [PATCH 1/4] Fix flaking tests --- plugins/player_auth/test/plugin.js | 5 ++++- test/integration/clusterio.js | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/player_auth/test/plugin.js b/plugins/player_auth/test/plugin.js index 6502bcc2..4cd2618a 100644 --- a/plugins/player_auth/test/plugin.js +++ b/plugins/player_auth/test/plugin.js @@ -286,11 +286,14 @@ describe("player_auth", function() { new SetVerifyCodeRequest("test", verify_code) ); + const user = controllerPlugin.controller.userManager.getByName("test"); + const token = controllerPlugin.controller.userManager.signUserToken(user); const verifyResult = await postJSON( `${controllerUrl}/api/player_auth/verify`, { player_code: playerCode, verify_code, verify_token } ); - assert.equal((await verifyResult.json()).verified, true); + assert.equal(verifyResult.status, 200); + assert.deepEqual(await verifyResult.json(), { verified: true, token: token }); }); }); }); diff --git a/test/integration/clusterio.js b/test/integration/clusterio.js index e4e4132d..72024886 100644 --- a/test/integration/clusterio.js +++ b/test/integration/clusterio.js @@ -707,9 +707,8 @@ describe("Integration of Clusterio", function() { for (let [, , configName, expectedResult] of testConfigs) { assert.equal(await sendRcon(44, `/config get ${configName}`), `${expectedResult}\n`); } - }); - it("should not change the instance status", async function() { - slowTest(this); + + // should not change instance status await checkInstanceStatus(44, "running"); }); it("should allow creating and removing props", async function() { From 0bbaef4751d4ef47fbb5f01e6c90650aa9dc0168 Mon Sep 17 00:00:00 2001 From: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com> Date: Tue, 20 May 2025 22:55:28 +0100 Subject: [PATCH 2/4] Remove node 18 add factorio 2.0 --- .github/workflows/node.js.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 2fe51267..f0770a01 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -12,10 +12,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [18.x, 20.x, 22.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - factorio-version: [1.1.110] - # Supported versions are latest stable/experimental and one minor version before stable (even if from a previous major) + # Supported versions are active lts and maintenance see https://nodejs.org/en/about/releases/ + node-version: [20.x, 22.x] + # Supported versions are latest stable and one minor version before stable (even if from a previous major) + factorio-version: [1.1.110, 2.0.47] steps: - uses: actions/checkout@v4 @@ -31,13 +31,13 @@ jobs: - name: Use Factorio ${{ matrix.factorio-version }} run: wget -q -O factorio.tar.gz https://www.factorio.com/get-download/${{ matrix.factorio-version }}/headless/linux64 && tar -xf factorio.tar.gz && rm factorio.tar.gz - name: Run tests - if: ${{ matrix.node-version != '18.x' || matrix.factorio-version != '1.1.110' }} + if: ${{ matrix.node-version != '20.x' || matrix.factorio-version != '1.1.110' }} run: pnpm test - name: Run coverage - if: ${{ matrix.node-version == '18.x' && matrix.factorio-version == '1.1.110' }} + if: ${{ matrix.node-version == '20.x' && matrix.factorio-version == '1.1.110' }} run: pnpm run ci-cover - name : Upload coverage to Codecov - if: ${{ matrix.node-version == '18.x' && matrix.factorio-version == '1.1.110' }} + if: ${{ matrix.node-version == '20.x' && matrix.factorio-version == '1.1.110' }} uses: codecov/codecov-action@v4 with: files: ./coverage/lcov.info From 4f6abca9d7ac48cf6d9f48aaec62b30d81e8aa9d Mon Sep 17 00:00:00 2001 From: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com> Date: Tue, 20 May 2025 23:17:59 +0100 Subject: [PATCH 3/4] Bump ts module as per node 20 recommended --- tsconfig.node.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.node.json b/tsconfig.node.json index dd436f25..da0a3006 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -2,7 +2,7 @@ "extends": "./tsconfig.base.json", "compilerOptions": { "lib": ["es2023"], - "module": "node16", + "module": "nodenext", "moduleResolution": "node16", "target": "es2022", "forceConsistentCasingInFileNames": true, From 773c98b31a75f4b6413bb7a63c61b6e9c71a5b49 Mon Sep 17 00:00:00 2001 From: Danielv123 Date: Sun, 25 May 2025 22:46:25 +0200 Subject: [PATCH 4/4] Prepare factorio 2.0 in devcontainer --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 58c111f3..e9310ec6 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,4 +1,4 @@ { "image":"mcr.microsoft.com/devcontainers/universal:2", - "postCreateCommand": "wget https://factorio.com/get-download/1.1.107/headless/linux64 && tar -xf linux64 && pnpm install", + "postCreateCommand": "mkdir factorio && cd factorio && wget https://factorio.com/get-download/1.1.107/headless/linux64 && tar -xf linux64 && mv factorio factorio_1.1.107 && rm linux64 && wget https://factorio.com/get-download/2.0.47/headless/linux64 && tar -xf linux64 && mv factorio factorio_2.0.47 && rm linux64 && pnpm install", }