Skip to content

Commit

Permalink
Improve version handling in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rom1504 committed Dec 17, 2023
1 parent 9486f2c commit fd804d5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 34 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,30 @@ on:
pull_request:

jobs:
Lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js 18.x
uses: actions/[email protected]
with:
node-version: 18.x
- run: npm i && npm run lint
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]
javaVersion: [1.8]
mcVersionIndex: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
javaVersion: [17]
mcVersion: ['1.8.8', '1.9.4', '1.10.2', '1.11.2', '1.12.2', '1.13.2', '1.14.4', '1.15.2', '1.16.1', '1.16.4']
include:
- javaVersion: 16
mcVersionIndex: 10
mcVersionIndex: '1.17.1'
- javaVersion: 17
mcVersionIndex: 11
mcVersionIndex: '1.18.1'
fail-fast: false

steps:
Expand All @@ -36,10 +46,7 @@ jobs:
- name: Install xi
run: sudo apt-get install -y libxi-dev libglu1-mesa-dev
- run: npm install
- env:
CIRCLE_NODE_INDEX: ${{ matrix.mcVersionIndex }}
CIRCLE_NODE_TOTAL: 12
run: npm test
- run: npm run jestTest -- -t ${{ matrix.mcVersion }}
- uses: actions/upload-artifact@v2
with:
name: test_picture
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Web based viewer",
"main": "index.js",
"scripts": {
"test": "jest --verbose --runInBand --forceExit",
"jestTest": "jest --verbose --runInBand --forceExit",
"test": "npm run test",
"pretest": "npm run lint",
"lint": "standard",
"prepare": "node viewer/prerender.js && webpack",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@ Stop the server and disconnect users.

## Tests

`node_modules/.bin/jest --verbose --runInBand --forceExit -t "1.16.4"`
`npm run jestTest -- -t "1.9.4"`
20 changes: 0 additions & 20 deletions test/parallel.js

This file was deleted.

5 changes: 1 addition & 4 deletions test/viewer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@ const os = require('os')

const Wrap = require('minecraft-wrap').Wrap

const { firstVersion, lastVersion } = require('./parallel')
const { getPort } = require('./common/util')

const download = require('minecraft-wrap').download
const TIMEOUT = 5 * 60 * 1000
const TIMEOUT_SCREENSHOT = 2 * 60 * 1000

supportedVersions.forEach(function (supportedVersion, i) {
if (!(i >= firstVersion && i <= lastVersion)) { return }

supportedVersions.forEach(function (supportedVersion) {
let PORT = null
const mcData = require('minecraft-data')(supportedVersion)
const version = mcData.version
Expand Down

0 comments on commit fd804d5

Please sign in to comment.