wdio-mediawiki 6.5.1 → 6.5.2

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.
@@ -212,10 +212,19 @@ function writeAllProjectMetrics( metricsDir, fileName ) {
212
212
  }
213
213
  }
214
214
 
215
+ const seen = new Set();
216
+ const uniqueTests = tests.filter( ( test ) => {
217
+ if ( seen.has( test.name ) ) {
218
+ return false;
219
+ }
220
+ seen.add( test.name );
221
+ return true;
222
+ } );
223
+
215
224
  const lines = [];
216
225
  const labels = projectMetrics.labels;
217
226
 
218
- const flakyTestsInRun = tests.filter( ( test ) => test.failed > 0 && test.retries > 0 ).length;
227
+ const flakyTestsInRun = uniqueTests.filter( ( test ) => test.failed > 0 && test.retries > 0 ).length;
219
228
 
220
229
  // Add Project metrics
221
230
  lines.push( '# HELP wdio_project_duration_seconds Total duration of all test suites per project' );
@@ -263,7 +272,7 @@ function writeAllProjectMetrics( metricsDir, fileName ) {
263
272
  // Add test metrics
264
273
 
265
274
  let addMetaData = true;
266
- for ( const test of tests ) {
275
+ for ( const test of uniqueTests ) {
267
276
  const testLabels = { ...labels, test: test.name };
268
277
 
269
278
  if ( addMetaData ) {
package/chromeOptions.js CHANGED
@@ -1,9 +1,5 @@
1
1
  import fs from 'node:fs';
2
2
 
3
- const dockerExtraArgs = fs.existsSync( '/.dockerenv' ) ?
4
- [ '--no-sandbox', '--disable-gpu', '--disable-dev-shm-usage' ] :
5
- [];
6
-
7
3
  const baseArgs = [
8
4
  // Disable as much as possible to make Chrome clean
9
5
  // https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md
@@ -50,10 +46,16 @@ const prefs = {
50
46
 
51
47
  const excludeSwitches = [ 'enable-automation' ];
52
48
 
49
+ // Flags required when Chrome runs as root in a container (CI, fresh or
50
+ // quickstart). /.dockerenv is present in Docker containers but
51
+ // missing in Kubernetes pods (Catalyst), so also check for CI. See T426551.
52
+ const containerExtraArgs = [ '--no-sandbox', '--disable-gpu', '--disable-dev-shm-usage' ];
53
+ const inContainer = ( isCi ) => isCi || fs.existsSync( '/.dockerenv' );
54
+
53
55
  export const getChromeOptions = ( isCi ) => ( {
54
56
  ...( isCi && { binary: '/usr/bin/chromium' } ),
55
57
  args: [
56
- ...dockerExtraArgs,
58
+ ...( inContainer( isCi ) ? containerExtraArgs : [] ),
57
59
  ...baseArgs
58
60
  ],
59
61
  prefs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wdio-mediawiki",
3
- "version": "6.5.1",
3
+ "version": "6.5.2",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "description": "WebdriverIO plugin for testing a MediaWiki site.",
@@ -160,7 +160,7 @@ export const config = {
160
160
  onPrepare: function ( wdioConfig, capabilities ) {
161
161
  console.log( `Run test targeting ${ wdioConfig.baseUrl }` );
162
162
  logSystemInformation();
163
- console.log( `[Configuration] maxInstances ${ wdioConfig.maxInstances } (max tests running in parallel) ` );
163
+ console.log( `[Configuration] maxInstances ${ wdioConfig.maxInstances } (max test suites running in parallel) ` );
164
164
 
165
165
  const { maxInstances, useBrowserHeadless, recordVideo } = wdioConfig;
166
166