|
1 | 1 | 'use strict'
|
2 | 2 |
|
3 | 3 | const { exec, execSync } = require('child_process')
|
| 4 | +const satisfies = require('semifies') |
4 | 5 |
|
5 | 6 | const getPort = require('get-port')
|
6 | 7 | const { assert } = require('chai')
|
@@ -55,6 +56,12 @@ const NUM_RETRIES_EFD = 3
|
55 | 56 | const versions = [DD_MAJOR >= 6 ? '1.38.0' : '1.18.0', 'latest']
|
56 | 57 |
|
57 | 58 | versions.forEach((version) => {
|
| 59 | + // TODO: Remove this once we drop suppport for v5 |
| 60 | + const contextNewVersions = (...args) => { |
| 61 | + if (satisfies(version, '>=1.38.0') || version === 'latest') { |
| 62 | + context(...args) |
| 63 | + } |
| 64 | + } |
58 | 65 | describe(`playwright@${version}`, () => {
|
59 | 66 | let sandbox, cwd, receiver, childProcess, webAppPort, webPortWithRedirect
|
60 | 67 |
|
@@ -282,7 +289,7 @@ versions.forEach((version) => {
|
282 | 289 | )
|
283 | 290 | })
|
284 | 291 |
|
285 |
| - context('early flake detection', () => { |
| 292 | + contextNewVersions('early flake detection', () => { |
286 | 293 | it('retries new tests', (done) => {
|
287 | 294 | receiver.setSettings({
|
288 | 295 | early_flake_detection: {
|
@@ -820,7 +827,7 @@ versions.forEach((version) => {
|
820 | 827 | })
|
821 | 828 | })
|
822 | 829 |
|
823 |
| - context('known tests without early flake detection', () => { |
| 830 | + contextNewVersions('known tests without early flake detection', () => { |
824 | 831 | it('detects new tests without retrying them', (done) => {
|
825 | 832 | receiver.setSettings({
|
826 | 833 | known_tests_enabled: true
|
@@ -914,7 +921,7 @@ versions.forEach((version) => {
|
914 | 921 | })
|
915 | 922 | })
|
916 | 923 |
|
917 |
| - context('test management', () => { |
| 924 | + contextNewVersions('test management', () => { |
918 | 925 | context('attempt to fix', () => {
|
919 | 926 | beforeEach(() => {
|
920 | 927 | receiver.setTestManagementTests({
|
@@ -1367,7 +1374,7 @@ versions.forEach((version) => {
|
1367 | 1374 | })
|
1368 | 1375 | })
|
1369 | 1376 |
|
1370 |
| - context('active test span', () => { |
| 1377 | + contextNewVersions('active test span', () => { |
1371 | 1378 | it('can grab the test span and add tags', (done) => {
|
1372 | 1379 | const receiverPromise = receiver
|
1373 | 1380 | .gatherPayloadsMaxTimeout(({ url }) => url === '/api/v2/citestcycle', (payloads) => {
|
@@ -1433,7 +1440,7 @@ versions.forEach((version) => {
|
1433 | 1440 | })
|
1434 | 1441 | })
|
1435 | 1442 |
|
1436 |
| - context('correlation between tests and RUM sessions', () => { |
| 1443 | + contextNewVersions('correlation between tests and RUM sessions', () => { |
1437 | 1444 | const getTestAssertions = ({ isRedirecting }) =>
|
1438 | 1445 | receiver
|
1439 | 1446 | .gatherPayloadsMaxTimeout(({ url }) => url === '/api/v2/citestcycle', (payloads) => {
|
|
0 commit comments