mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
test: redo cockroachdb to service-container GHA and update its version to latest (24) (#11190)
This commit is contained in:
parent
af603ae5cf
commit
53f253d527
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
@ -16,16 +16,20 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [16.x, 18.x, 20.x] #, 22.x]
|
||||
node-container: ["node:16", "node:18", "node:20"] #, "node:22"]
|
||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||
|
||||
container: ${{ matrix.node-container }}
|
||||
services:
|
||||
crdb:
|
||||
image: cockroachdb/cockroach
|
||||
env:
|
||||
COCKROACH_ARGS: 'start-single-node --insecure --cache=1GB --store=type=mem,size=4GB'
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{matrix.node-version}}
|
||||
- uses: actions/checkout@v4
|
||||
- run: docker compose -f .github/workflows/test/cockroachdb.docker-compose up -d
|
||||
- run: npm i
|
||||
- run: chown -R 1001:127 /github/home/.npm #This fix is needed for running CLI tests
|
||||
- run: cp .github/workflows/test/cockroachdb.ormconfig.json ormconfig.json
|
||||
- run: npm test
|
||||
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
version: "3"
|
||||
services:
|
||||
cockroachdb:
|
||||
image: "cockroachdb/cockroach:v23.1.9"
|
||||
container_name: "typeorm-cockroachdb"
|
||||
command: start-single-node --insecure --cache=0.75 --store=type=mem,size=0.75
|
||||
ports:
|
||||
- "26257:26257"
|
||||
@ -3,11 +3,12 @@
|
||||
"skip": false,
|
||||
"name": "cockroachdb",
|
||||
"type": "cockroachdb",
|
||||
"host": "localhost",
|
||||
"host": "crdb",
|
||||
"port": 26257,
|
||||
"username": "root",
|
||||
"password": "",
|
||||
"database": "defaultdb"
|
||||
"database": "defaultdb",
|
||||
"logging": false
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
@ -225,7 +225,9 @@ export class CockroachQueryRunner
|
||||
} else {
|
||||
this.storeQueries = false
|
||||
this.transactionDepth -= 1
|
||||
await this.query("RELEASE SAVEPOINT cockroach_restart")
|
||||
// This was disabled because it failed tests after update to CRDB 24.2
|
||||
// https://github.com/typeorm/typeorm/pull/11190
|
||||
// await this.query("RELEASE SAVEPOINT cockroach_restart")
|
||||
await this.query("COMMIT")
|
||||
this.queries = []
|
||||
this.isTransactionActive = false
|
||||
@ -1019,7 +1021,7 @@ export class CockroachQueryRunner
|
||||
const enumColumns = newTable.columns.filter(
|
||||
(column) => column.type === "enum" || column.type === "simple-enum",
|
||||
)
|
||||
for (let column of enumColumns) {
|
||||
for (const column of enumColumns) {
|
||||
// skip renaming for user-defined enum name
|
||||
if (column.enumName) continue
|
||||
|
||||
@ -3903,7 +3905,7 @@ export class CockroachQueryRunner
|
||||
table: Table,
|
||||
indexOrName: TableIndex | TableUnique | string,
|
||||
): Query {
|
||||
let indexName =
|
||||
const indexName =
|
||||
InstanceChecker.isTableIndex(indexOrName) ||
|
||||
InstanceChecker.isTableUnique(indexOrName)
|
||||
? indexOrName.name
|
||||
|
||||
@ -975,7 +975,10 @@ describe("query builder > locking", () => {
|
||||
.createQueryBuilder(Post, "post")
|
||||
.leftJoin("post.author", "user")
|
||||
.setLock("pessimistic_write")
|
||||
.getOne(),
|
||||
.getOne()
|
||||
.should.be.rejectedWith(
|
||||
"FOR UPDATE cannot be applied to the nullable side of an outer join",
|
||||
),
|
||||
])
|
||||
})
|
||||
}
|
||||
|
||||
@ -638,11 +638,17 @@ describe("repository > find options > locking", () => {
|
||||
tables: ["post"],
|
||||
},
|
||||
}),
|
||||
entityManager.getRepository(Post).findOne({
|
||||
where: { id: 1 },
|
||||
relations: { author: true },
|
||||
lock: { mode: "pessimistic_write" },
|
||||
}),
|
||||
entityManager
|
||||
.getRepository(Post)
|
||||
.findOne({
|
||||
where: { id: 1 },
|
||||
relations: { author: true },
|
||||
lock: { mode: "pessimistic_write" },
|
||||
})
|
||||
.should.be.rejectedWith(
|
||||
"FOR UPDATE cannot be applied to the nullable side of an outer join",
|
||||
),
|
||||
,
|
||||
])
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user