diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 580260c..79e0818 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,15 +5,20 @@ on: branches: [ '*', '!gh-pages' ] pull_request: branches: [ '*', '!gh-pages' ] + workflow_dispatch: + inputs: + via: + description: 'trigger origin' + required: true jobs: build: - runs-on: ubuntu-latest - timeout-minutes: 10 - strategy: matrix: - node-version: [14.x] + os: [ubuntu-latest, windows-latest] + node-version: [16.x] + runs-on: ${{ matrix.os }} + timeout-minutes: 10 steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} diff --git a/test/internal.test.js b/test/internal.test.js index d6c11d8..6e81c43 100644 --- a/test/internal.test.js +++ b/test/internal.test.js @@ -17,12 +17,17 @@ describe('internal client/server test', function () { }) } - for (const version in Versions) { - it('proxies ' + version, async () => { - console.debug(version) - await proxyTest(version) - await sleep(5000) - console.debug('Done', version) - }) + if (process.env.CI && process.platform === 'linux') { + // Don't run the test, see : + // https://github.com/PrismarineJS/bedrock-protocol/issues/124 + } else { + for (const version in Versions) { + it('proxies ' + version, async () => { + console.debug(version) + await proxyTest(version) + await sleep(5000) + console.debug('Done', version) + }) + } } }) diff --git a/test/proxy.js b/test/proxy.js index 2ea17b9..2d94e05 100644 --- a/test/proxy.js +++ b/test/proxy.js @@ -3,9 +3,11 @@ const { sleep, waitFor } = require('../src/datatypes/util') function proxyTest (version, timeout = 1000 * 40) { return waitFor(res => { + const SERVER_PORT = 19000 + ((Math.random() * 100) | 0) + const CLIENT_PORT = 19000 + ((Math.random() * 100) | 0) const server = createServer({ host: '0.0.0.0', // optional - port: 19131, // optional + port: SERVER_PORT, // optional offline: true, version // The server version }) @@ -27,11 +29,11 @@ function proxyTest (version, timeout = 1000 * 40) { offline: true, /* host and port for clients to listen to */ host: '0.0.0.0', - port: 19132, + port: CLIENT_PORT, /* Where to send upstream packets to */ destination: { host: '127.0.0.1', - port: 19131 + port: SERVER_PORT } }) relay.conLog = console.debug @@ -39,7 +41,7 @@ function proxyTest (version, timeout = 1000 * 40) { console.debug('Proxy started', server.options.version) - const client = createClient({ host: '127.0.0.1', version, username: 'Boat', offline: true }) + const client = createClient({ host: '127.0.0.1', port: CLIENT_PORT, version, username: 'Boat', offline: true }) console.debug('Client started')