@playwright-orchestrator/mongo 1.5.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,8 +41,7 @@ let MongoDbAdapter = class MongoDbAdapter extends BaseAdapter {
41
41
  runId,
42
42
  config,
43
43
  shards,
44
- tests: tests.map(({ file, line, column, status, report, projects }) => {
45
- const position = `${line}:${column}`;
44
+ tests: tests.map(({ status, report, meta: { file, position, projects } }) => {
46
45
  const { duration, fails, title, lastSuccessfulRun, ema } = report;
47
46
  return {
48
47
  file,
@@ -35,7 +35,7 @@ let MongoShardHandler = class MongoShardHandler {
35
35
  }
36
36
  async claimNextTest(runId, project) {
37
37
  const query = project
38
- ? { ...this.generateTestIdQuery(runId, TestStatus.Ready), projects: project }
38
+ ? { ...this.generateTestIdQuery(runId, TestStatus.Ready), 'meta.projects': project }
39
39
  : this.generateTestIdQuery(runId, TestStatus.Ready);
40
40
  const result = await this.tests.findOneAndUpdate(query, {
41
41
  $set: { updated: new Date(), status: TestStatus.Ongoing },
@@ -44,9 +44,9 @@ let MongoShardHandler = class MongoShardHandler {
44
44
  return undefined;
45
45
  const effectiveEma = result.ema;
46
46
  await this.runs.updateOne({ _id: generateRunId(runId) }, { $inc: { 'config.remainingCount': -1, 'config.remainingTime': -effectiveEma } });
47
- const { file, line, column, projects, timeout, ema, children, testId } = result;
47
+ const { timeout, ema, testId, meta } = result;
48
48
  const { order } = parseTestId(result._id);
49
- return { file, position: `${line}:${column}`, projects, timeout, ema, order, children, testId };
49
+ return { timeout, ema, order, testId, meta };
50
50
  }
51
51
  async startShard() {
52
52
  const { runId, shardId } = this.runContext;
@@ -62,20 +62,15 @@ let MongoTestRunCreator = class MongoTestRunCreator extends BaseTestRunCreator {
62
62
  await this.connection.db.collection(this.runsCollection).insertOne(run);
63
63
  if (tests.length === 0)
64
64
  return;
65
- await this.connection.db.collection(this.testsCollection).insertMany(tests.map(({ file, order, position, projects, timeout, ema, children, testId }) => {
66
- const [line, column] = position.split(':').map(Number);
65
+ await this.connection.db.collection(this.testsCollection).insertMany(tests.map(({ order, timeout, ema, testId, meta }) => {
67
66
  return {
68
67
  _id: generateTestId(runId, order),
69
68
  testId,
70
- file,
71
- projects,
72
69
  timeout,
73
70
  ema,
74
- line,
75
- column,
76
71
  status: TestStatus.Ready,
77
72
  updated: now,
78
- children,
73
+ meta,
79
74
  ...(this.debug ? { runId, order } : {}),
80
75
  };
81
76
  }));
package/dist/types.d.ts CHANGED
@@ -7,12 +7,10 @@ export interface TestRunDocument extends Document {
7
7
  config: TestRunConfig;
8
8
  updated: Date;
9
9
  }
10
- export interface TestDocument extends Document, Omit<TestItem, 'order' | 'position'> {
10
+ export interface TestDocument extends Document, Omit<TestItem, 'order'> {
11
11
  _id: Binary;
12
12
  runId?: string;
13
13
  order?: number;
14
- line: number;
15
- column: number;
16
14
  status: TestStatus;
17
15
  updated: Date;
18
16
  report?: TestItemReport;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playwright-orchestrator/mongo",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
4
4
  "keywords": [],
5
5
  "author": "Rostyslav Kudrevatykh",
6
6
  "license": "Apache-2.0",
@@ -18,7 +18,7 @@
18
18
  "inversify": "^8.0.0-beta.0",
19
19
  "mongodb": "^6.12.0",
20
20
  "uuid": "^14.0.0",
21
- "@playwright-orchestrator/core": "1.5.1"
21
+ "@playwright-orchestrator/core": "1.6.0"
22
22
  },
23
23
  "devDependencies": {},
24
24
  "main": "dist/index.js",