Skip to content

Commit

Permalink
test(NODE-5929): convert txn legacy spec tests (#3987)
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Feb 28, 2024
1 parent f26de76 commit 1ca6269
Show file tree
Hide file tree
Showing 180 changed files with 50,370 additions and 38,833 deletions.

This file was deleted.

@@ -0,0 +1,39 @@
import * as path from 'path';

import { loadSpecTests } from '../../spec';
import { runUnifiedSuite } from '../../tools/unified-spec-runner/runner';

const SKIPPED_TESTS = [
'callback succeeds after multiple connection errors',
'callback is not retried after non-transient error',
'callback is not retried after non-transient error (DuplicateKeyError)',
'withTransaction succeeds if callback aborts',
'unpin after transient error within a transaction',
'withTransaction succeeds if callback commits',
'withTransaction still succeeds if callback aborts and runs extra op',
'withTransaction still succeeds if callback commits and runs extra op',
'withTransaction commits after callback returns (second transaction)',
'withTransaction commits after callback returns',
'withTransaction and no transaction options set',
'withTransaction inherits transaction options from defaultTransactionOptions',
'withTransaction explicit transaction options override defaultTransactionOptions',
'withTransaction explicit transaction options'
];

describe('Transactions Convenient API Spec Unified Tests', function () {
beforeEach(function () {
if (this.configuration.topologyType === 'LoadBalanced') {
if (this.currentTest) {
this.currentTest.skipReason =
'TODO(NODE-5931) - Fix socket leaks in load balancer transaction tests.';
}
this.skip();
}
});

runUnifiedSuite(loadSpecTests(path.join('transactions-convenient-api', 'unified')), test => {
return SKIPPED_TESTS.includes(test.description)
? 'TODO(NODE-5855/DRIVERS-2816): Skipping failing transaction tests'
: false;
});
});
137 changes: 0 additions & 137 deletions test/integration/transactions/transactions.spec.test.js

This file was deleted.

34 changes: 34 additions & 0 deletions test/integration/transactions/transactions.spec.test.ts
@@ -0,0 +1,34 @@
import * as path from 'path';

import { loadSpecTests } from '../../spec';
import { runUnifiedSuite } from '../../tools/unified-spec-runner/runner';

const SKIPPED_TESTS = [
// TODO(NODE-5925) - secondary read preference not allowed in transactions.
'readPreference inherited from defaultTransactionOptions',
// TODO(NODE-5924) - Fix modification of readConcern object post message send.
'readConcern local in defaultTransactionOptions',
'defaultTransactionOptions override client options',
'transaction options inherited from defaultTransactionOptions',
'transaction options inherited from client',
'causal consistency disabled'
// TODO(NODE-5855) - Gone away after NODE-5929
];

describe('Transactions Spec Unified Tests', function () {
this.beforeEach(function () {
if (this.configuration.topologyType === 'LoadBalanced') {
if (this.currentTest) {
this.currentTest.skipReason =
'TODO(NODE-5931) - Fix socket leaks in load balancer transaction tests.';
}
}
this.skip();
});

runUnifiedSuite(loadSpecTests(path.join('transactions', 'unified')), test => {
return SKIPPED_TESTS.includes(test.description)
? 'TODO(NODE-5924/NODE-5925): Skipping failing transaction tests'
: false;
});
});
Expand Up @@ -23,6 +23,20 @@ const filter: TestFilter = ({ description }) => {
return 'TODO(NODE-3308): failures due unnecessary getMore and killCursors calls in 5.0';
}

if (
[
'withTransaction and no transaction options set',
'withTransaction inherits transaction options from client',
'withTransaction inherits transaction options from defaultTransactionOptions',
'withTransaction explicit transaction options',
'remain pinned after non-transient Interrupted error on insertOne',
'unpin after transient error within a transaction',
'remain pinned after non-transient Interrupted error on insertOne'
].includes(description)
) {
return 'TODO(DRIVERS-2816): fix migration conflict in transaction tests';
}

if (
process.env.AUTH === 'auth' &&
[
Expand Down

0 comments on commit 1ca6269

Please sign in to comment.