Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix errors in ci github action for node 8 and 9 #523

Merged
merged 6 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 35 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
- Node.js 17.x
- Node.js 18.x
- Node.js 19.x
- Node.js 20.x
- Node.js 21.x
- Node.js 22.x

include:
- name: Node.js 0.8
Expand All @@ -48,77 +51,86 @@ jobs:
npm-i: [email protected] [email protected] [email protected]

- name: io.js 1.x
node-version: "1.8"
node-version: "1"
npm-i: [email protected] [email protected] [email protected]

- name: io.js 2.x
node-version: "2.5"
node-version: "2"
npm-i: [email protected] [email protected] [email protected]

- name: io.js 3.x
node-version: "3.3"
node-version: "3"
npm-i: [email protected] [email protected] [email protected]

- name: Node.js 4.x
node-version: "4.9"
node-version: "4"
npm-i: [email protected] [email protected] [email protected]

- name: Node.js 5.x
node-version: "5.12"
node-version: "5"
npm-i: [email protected] [email protected] [email protected]

- name: Node.js 6.x
node-version: "6.17"
node-version: "6"
npm-i: [email protected] [email protected] [email protected]

- name: Node.js 7.x
node-version: "7.10"
node-version: "7"
npm-i: [email protected] [email protected] [email protected]

- name: Node.js 8.x
node-version: "8.17"
npm-i: [email protected]
node-version: "8"
npm-i: [email protected] [email protected]

- name: Node.js 9.x
node-version: "9.11"
npm-i: [email protected]
node-version: "9"
npm-i: [email protected] [email protected]

- name: Node.js 10.x
node-version: "10.24"
node-version: "10"
npm-i: [email protected]

- name: Node.js 11.x
node-version: "11.15"
node-version: "11"
npm-i: [email protected]

- name: Node.js 12.x
node-version: "12.22"
node-version: "12"
npm-i: [email protected]

- name: Node.js 13.x
node-version: "13.14"
node-version: "13"
npm-i: [email protected]

- name: Node.js 14.x
node-version: "14.21"
node-version: "14"

- name: Node.js 15.x
node-version: "15.14"
node-version: "15"

- name: Node.js 16.x
node-version: "16.19"
node-version: "16"

- name: Node.js 17.x
node-version: "17.9"
node-version: "17"

- name: Node.js 18.x
node-version: "18.14"
node-version: "18"

- name: Node.js 19.x
node-version: "19.7"
node-version: "19"

- name: Node.js 20.x
node-version: "20"

- name: Node.js 21.x
node-version: "21"

- name: Node.js 22.x
node-version: "22"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Node.js ${{ matrix.node-version }}
shell: bash -eo pipefail -l {0}
Expand Down Expand Up @@ -209,7 +221,7 @@ jobs:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install lcov
shell: bash
Expand Down
20 changes: 16 additions & 4 deletions test/body-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,25 @@ describe('bodyParser()', function () {
})
})

function getMajorVersion (versionString) {
return versionString.split('.')[0]
}

function shouldSkipQuery (versionString) {
// Skipping HTTP QUERY tests on Node 21, it is reported in http.METHODS on 21.7.2 but not supported
// update this implementation to run on supported versions of 21 once they exist
// upstream tracking https://github.com/nodejs/node/issues/51562
// express tracking issue: https://github.com/expressjs/express/issues/5615
return getMajorVersion(versionString) === '21'
}

methods.slice().sort().forEach(function (method) {
if (method === 'connect') {
// except CONNECT
return
}
if (method === 'connect') return

it('should support ' + method.toUpperCase() + ' requests', function (done) {
if (method === 'query' && shouldSkipQuery(process.versions.node)) {
this.skip()
}
request(this.server)[method]('/')
.set('Content-Type', 'application/json')
.set('Content-Length', '15')
Expand Down
Loading