mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 00:13:13 +09:00
Merge pull request #767 from Cooldude2606/tests/factorio-2.0
Bump tests: Remove Node 18 & Add Factorio 2.0
This commit is contained in:
5 files changed
+15
-13
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"image":"mcr.microsoft.com/devcontainers/universal:2",
|
"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",
|
||||||
}
|
}
|
||||||
@@ -12,10 +12,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [18.x, 20.x, 22.x]
|
# Supported versions are active lts and maintenance see https://nodejs.org/en/about/releases/
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
node-version: [20.x, 22.x]
|
||||||
factorio-version: [1.1.110]
|
# Supported versions are latest stable and one minor version before stable (even if from a previous major)
|
||||||
# Supported versions are latest stable/experimental and one minor version before stable (even if from a previous major)
|
factorio-version: [1.1.110, 2.0.47]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -31,13 +31,13 @@ jobs:
|
|||||||
- name: Use Factorio ${{ matrix.factorio-version }}
|
- 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
|
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
|
- 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
|
run: pnpm test
|
||||||
- name: Run coverage
|
- 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
|
run: pnpm run ci-cover
|
||||||
- name : Upload coverage to Codecov
|
- 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
|
uses: codecov/codecov-action@v4
|
||||||
with:
|
with:
|
||||||
files: ./coverage/lcov.info
|
files: ./coverage/lcov.info
|
||||||
|
|||||||
@@ -286,11 +286,14 @@ describe("player_auth", function() {
|
|||||||
new SetVerifyCodeRequest("test", verify_code)
|
new SetVerifyCodeRequest("test", verify_code)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const user = controllerPlugin.controller.userManager.getByName("test");
|
||||||
|
const token = controllerPlugin.controller.userManager.signUserToken(user);
|
||||||
const verifyResult = await postJSON(
|
const verifyResult = await postJSON(
|
||||||
`${controllerUrl}/api/player_auth/verify`,
|
`${controllerUrl}/api/player_auth/verify`,
|
||||||
{ player_code: playerCode, verify_code, verify_token }
|
{ 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 });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -707,9 +707,8 @@ describe("Integration of Clusterio", function() {
|
|||||||
for (let [, , configName, expectedResult] of testConfigs) {
|
for (let [, , configName, expectedResult] of testConfigs) {
|
||||||
assert.equal(await sendRcon(44, `/config get ${configName}`), `${expectedResult}\n`);
|
assert.equal(await sendRcon(44, `/config get ${configName}`), `${expectedResult}\n`);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
it("should not change the instance status", async function() {
|
// should not change instance status
|
||||||
slowTest(this);
|
|
||||||
await checkInstanceStatus(44, "running");
|
await checkInstanceStatus(44, "running");
|
||||||
});
|
});
|
||||||
it("should allow creating and removing props", async function() {
|
it("should allow creating and removing props", async function() {
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.base.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"lib": ["es2023"],
|
"lib": ["es2023"],
|
||||||
"module": "node16",
|
"module": "nodenext",
|
||||||
"moduleResolution": "node16",
|
"moduleResolution": "node16",
|
||||||
"target": "es2022",
|
"target": "es2022",
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
|||||||
Reference in new issue
Block a user