Skip to content

Commit 1ca6269

Browse files
authored
test(NODE-5929): convert txn legacy spec tests (#3987)
1 parent f26de76 commit 1ca6269

File tree

180 files changed

+50370
-38833
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+50370
-38833
lines changed

test/integration/transactions-convenient-api/transactions-convenient-api.spec.test.js

Lines changed: 0 additions & 89 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import * as path from 'path';
2+
3+
import { loadSpecTests } from '../../spec';
4+
import { runUnifiedSuite } from '../../tools/unified-spec-runner/runner';
5+
6+
const SKIPPED_TESTS = [
7+
'callback succeeds after multiple connection errors',
8+
'callback is not retried after non-transient error',
9+
'callback is not retried after non-transient error (DuplicateKeyError)',
10+
'withTransaction succeeds if callback aborts',
11+
'unpin after transient error within a transaction',
12+
'withTransaction succeeds if callback commits',
13+
'withTransaction still succeeds if callback aborts and runs extra op',
14+
'withTransaction still succeeds if callback commits and runs extra op',
15+
'withTransaction commits after callback returns (second transaction)',
16+
'withTransaction commits after callback returns',
17+
'withTransaction and no transaction options set',
18+
'withTransaction inherits transaction options from defaultTransactionOptions',
19+
'withTransaction explicit transaction options override defaultTransactionOptions',
20+
'withTransaction explicit transaction options'
21+
];
22+
23+
describe('Transactions Convenient API Spec Unified Tests', function () {
24+
beforeEach(function () {
25+
if (this.configuration.topologyType === 'LoadBalanced') {
26+
if (this.currentTest) {
27+
this.currentTest.skipReason =
28+
'TODO(NODE-5931) - Fix socket leaks in load balancer transaction tests.';
29+
}
30+
this.skip();
31+
}
32+
});
33+
34+
runUnifiedSuite(loadSpecTests(path.join('transactions-convenient-api', 'unified')), test => {
35+
return SKIPPED_TESTS.includes(test.description)
36+
? 'TODO(NODE-5855/DRIVERS-2816): Skipping failing transaction tests'
37+
: false;
38+
});
39+
});

test/integration/transactions/transactions.spec.test.js

Lines changed: 0 additions & 137 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import * as path from 'path';
2+
3+
import { loadSpecTests } from '../../spec';
4+
import { runUnifiedSuite } from '../../tools/unified-spec-runner/runner';
5+
6+
const SKIPPED_TESTS = [
7+
// TODO(NODE-5925) - secondary read preference not allowed in transactions.
8+
'readPreference inherited from defaultTransactionOptions',
9+
// TODO(NODE-5924) - Fix modification of readConcern object post message send.
10+
'readConcern local in defaultTransactionOptions',
11+
'defaultTransactionOptions override client options',
12+
'transaction options inherited from defaultTransactionOptions',
13+
'transaction options inherited from client',
14+
'causal consistency disabled'
15+
// TODO(NODE-5855) - Gone away after NODE-5929
16+
];
17+
18+
describe('Transactions Spec Unified Tests', function () {
19+
this.beforeEach(function () {
20+
if (this.configuration.topologyType === 'LoadBalanced') {
21+
if (this.currentTest) {
22+
this.currentTest.skipReason =
23+
'TODO(NODE-5931) - Fix socket leaks in load balancer transaction tests.';
24+
}
25+
}
26+
this.skip();
27+
});
28+
29+
runUnifiedSuite(loadSpecTests(path.join('transactions', 'unified')), test => {
30+
return SKIPPED_TESTS.includes(test.description)
31+
? 'TODO(NODE-5924/NODE-5925): Skipping failing transaction tests'
32+
: false;
33+
});
34+
});

test/integration/unified-test-format/unified_test_format.spec.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ const filter: TestFilter = ({ description }) => {
2323
return 'TODO(NODE-3308): failures due unnecessary getMore and killCursors calls in 5.0';
2424
}
2525

26+
if (
27+
[
28+
'withTransaction and no transaction options set',
29+
'withTransaction inherits transaction options from client',
30+
'withTransaction inherits transaction options from defaultTransactionOptions',
31+
'withTransaction explicit transaction options',
32+
'remain pinned after non-transient Interrupted error on insertOne',
33+
'unpin after transient error within a transaction',
34+
'remain pinned after non-transient Interrupted error on insertOne'
35+
].includes(description)
36+
) {
37+
return 'TODO(DRIVERS-2816): fix migration conflict in transaction tests';
38+
}
39+
2640
if (
2741
process.env.AUTH === 'auth' &&
2842
[

0 commit comments

Comments
 (0)