Skip to content

Commit af603ae

Browse files
authored
test: Expand node version matrix to node16, node18, and node20 (typeorm#11183)
1 parent 40204e6 commit af603ae

File tree

6 files changed

+27
-16
lines changed

6 files changed

+27
-16
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
node-version: [18.x] #["node:16", "node:18", "node:20", "node:22"]
19+
node-version: [16.x, 18.x, 20.x] #, 22.x]
2020
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2121

2222
steps:
@@ -35,7 +35,7 @@ jobs:
3535
strategy:
3636
fail-fast: false
3737
matrix:
38-
node-container: ["node:18"] #["node:16", "node:18", "node:20", "node:22"]
38+
node-container: ["node:16", "node:18", "node:20"] #, "node:22"]
3939
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
4040

4141
container: ${{ matrix.node-container }}
@@ -46,6 +46,7 @@ jobs:
4646
steps:
4747
- uses: actions/checkout@v4
4848
- run: npm i
49+
- run: chown -R 1001:127 /github/home/.npm #This fix is needed for running CLI tests
4950
- run: cp .github/workflows/test/mongodb.ormconfig.json ormconfig.json
5051
- run: npm test
5152

@@ -55,7 +56,7 @@ jobs:
5556
strategy:
5657
fail-fast: false
5758
matrix:
58-
node-container: ["node:18"] #["node:16", "node:18", "node:20", "node:22"]
59+
node-container: ["node:16", "node:18", "node:20"] #, "node:22"]
5960
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
6061

6162
container: ${{ matrix.node-container }}
@@ -69,6 +70,7 @@ jobs:
6970
steps:
7071
- uses: actions/checkout@v4
7172
- run: npm i
73+
- run: chown -R 1001:127 /github/home/.npm #This fix is needed for running CLI tests
7274
- run: cp .github/workflows/test/mssql.ormconfig.json ormconfig.json
7375
- run: npm test
7476

@@ -78,7 +80,7 @@ jobs:
7880
strategy:
7981
fail-fast: false
8082
matrix:
81-
node-container: ["node:18"] #["node:16", "node:18", "node:20", "node:22"]
83+
node-container: ["node:16", "node:18", "node:20"] #, "node:22"]
8284
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
8385

8486
container: ${{ matrix.node-container }}
@@ -101,6 +103,7 @@ jobs:
101103
steps:
102104
- uses: actions/checkout@v4
103105
- run: npm i
106+
- run: chown -R 1001:127 /github/home/.npm #This fix is needed for running CLI tests
104107
- run: cp .github/workflows/test/mysql-mariadb.ormconfig.json ormconfig.json
105108
- run: npm test
106109

@@ -110,7 +113,7 @@ jobs:
110113
strategy:
111114
fail-fast: false
112115
matrix:
113-
node-version: [18.x] #["node:16", "node:18", "node:20", "node:22"]
116+
node-version: [16.x, 18.x, 20.x] #, 22.x]
114117
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
115118

116119
steps:
@@ -129,14 +132,16 @@ jobs:
129132
strategy:
130133
fail-fast: false
131134
matrix:
132-
node-container: ["node:18"] #["node:16", "node:18", "node:20", "node:22"]
135+
node-container: ["node:16", "node:18", "node:20"] #, "node:22"]
133136
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
134137

135138
container: ${{ matrix.node-container }}
136139

137140
steps:
138141
- uses: actions/checkout@v4
139142
- run: npm i
143+
- run: chown -R 1001:127 /github/home/.npm #This fix is needed for running CLI tests
144+
- run: chown -R 1001:127 ./temp #This fix is needed for fixing permission error on Node 16
140145
- run: cp .github/workflows/test/better-sqlite3.ormconfig.json ormconfig.json
141146
- run: npm test
142147

@@ -146,14 +151,16 @@ jobs:
146151
strategy:
147152
fail-fast: false
148153
matrix:
149-
node-container: ["node:18"] #["node:16", "node:18", "node:20", "node:22"]
154+
node-container: ["node:16", "node:18", "node:20"] #, "node:22"]
150155
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
151156

152157
container: ${{ matrix.node-container }}
153158

154159
steps:
155160
- uses: actions/checkout@v4
156161
- run: npm i
162+
- run: chown -R 1001:127 /github/home/.npm #This fix is needed for running CLI tests
163+
- run: chown -R 1001:127 ./temp #This fix is needed for fixing permission error on Node 16
157164
- run: cp .github/workflows/test/sqlite.ormconfig.json ormconfig.json
158165
- run: npm test
159166

@@ -163,14 +170,15 @@ jobs:
163170
strategy:
164171
fail-fast: false
165172
matrix:
166-
node-container: ["node:18"] #["node:16", "node:18", "node:20", "node:22"]
173+
node-container: ["node:16", "node:18", "node:20"] #, "node:22"]
167174
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
168175

169176
container: ${{ matrix.node-container }}
170177

171178
steps:
172179
- uses: actions/checkout@v4
173180
- run: npm i
181+
- run: chown -R 1001:127 /github/home/.npm #This fix is needed for running CLI tests
174182
- run: cp .github/workflows/test/sqljs.ormconfig.json ormconfig.json
175183
- run: npm test
176184

@@ -180,7 +188,7 @@ jobs:
180188
strategy:
181189
fail-fast: false
182190
matrix:
183-
node-container: ["node:18"] #["node:16", "node:18", "node:20", "node:22"]
191+
node-container: ["node:16", "node:18", "node:20"] #, "node:22"]
184192
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
185193

186194
container: ${{ matrix.node-container }}
@@ -200,5 +208,6 @@ jobs:
200208
steps:
201209
- uses: actions/checkout@v4
202210
- run: npm i
211+
- run: chown -R 1001:127 /github/home/.npm #This fix is needed for running CLI tests
203212
- run: cp .github/workflows/test/postgres.ormconfig.json ormconfig.json
204213
- run: npm test

.github/workflows/test/better-sqlite3.ormconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"skip": false,
44
"name": "better-sqlite3",
55
"type": "better-sqlite3",
6-
"database": "temp/better-sqlite3db.db",
6+
"database": "./temp/better-sqlite3db.db",
77
"logging": false
88
},
99

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
"peerDependencies": {
151151
"@google-cloud/spanner": "^5.18.0",
152152
"@sap/hana-client": "^2.12.25",
153-
"better-sqlite3": "^7.1.2 || ^8.0.0 || ^9.0.0",
153+
"better-sqlite3": "^8.0.0 || ^9.0.0",
154154
"hdb-pool": "^0.1.6",
155155
"ioredis": "^5.0.4",
156156
"mongodb": "^5.8.0",

src/commands/InitCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ Steps to run this project:
717717
packageJson.dependencies["sqlite3"] = "^5.0.2"
718718
break
719719
case "better-sqlite3":
720-
packageJson.dependencies["better-sqlite3"] = "^7.0.0"
720+
packageJson.dependencies["better-sqlite3"] = "^8.0.0"
721721
break
722722
case "oracle":
723723
packageJson.dependencies["oracledb"] = "^5.1.0"

test/github-issues/10209/issue-10209.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ describe("github issues > #10209", () => {
2626
beforeEach(() => reloadTestingDatabases(dataSources))
2727
after(() => closeTestingConnections(dataSources))
2828

29-
it("should not fail to run multiple nested transactions in parallel", () =>
30-
Promise.all(
29+
it("should not fail to run multiple nested transactions in parallel", function () {
30+
this.retries(3) // Fix for SQLite
31+
return Promise.all(
3132
dataSources.map(async (dataSource) => {
3233
const manager = dataSource.createEntityManager()
3334

@@ -84,5 +85,6 @@ describe("github issues > #10209", () => {
8485
// We only care that the transaction above didn't fail
8586
expect(true).to.be.true
8687
}),
87-
))
88+
)
89+
})
8890
})

0 commit comments

Comments
 (0)