Page MenuHomePhabricator

./tests/selenium/selenium.sh: 3: set: Illegal option -o pipefail
Closed, ResolvedPublic

Description

~/Documents/gerrit/mediawiki/core$ docker-compose up -d
Starting core_mediawiki_1 ... done
~/Documents/gerrit/mediawiki/core$ docker-compose exec mediawiki composer update
Do not run Composer as root/super user! See https://getcomposer.org/root for details
> ComposerHookHandler::onPreUpdate
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 9 updates, 0 removals
  - Updating pear/mail_mime (1.10.6 => 1.10.7): Downloading (100%)         
  - Updating wikimedia/base-convert (v2.0.0 => v2.0.1): Downloading (100%)         
  - Updating wikimedia/less.php (1.8.2 => v3.0.0): Downloading (100%)         
  - Updating composer/semver (1.5.0 => 1.5.1): Downloading (100%)         
  - Updating mediawiki/mediawiki-codesniffer (v29.0.0 => v30.0.0): Downloading (100%)         
  - Updating symfony/yaml (v4.3.4 => v5.0.5): Downloading (100%)         
  - Updating wikimedia/assert (v0.4.0 => v0.5.0): Downloading (100%)         
  - Updating wikimedia/parsoid (v0.12.0-a4 => v0.12.0-a5): Downloading (100%)         
  - Updating felixfbecker/advanced-json-rpc (v3.1.0 => v3.1.1): Downloading (100%)         
Package jakub-onderka/php-parallel-lint is abandoned, you should avoid using it. Use php-parallel-lint/php-parallel-lint instead.
Writing lock file
Generating optimized autoload files
> ComposerVendorHtaccessCreator::onEvent
~/Documents/gerrit/mediawiki/core$ docker-compose exec mediawiki \
bash -c 'php maintenance/install.php \
--server $MW_SERVER \
--scriptpath=$MW_SCRIPTPATH \
--dbtype $MW_DBTYPE \
--dbpath $MW_DBPATH \
--lang $MW_LANG \
--pass $MW_PASS \
$MW_SITENAME $MW_USER'
PHP 7.2.26-1+0~20191218.33+debian9~1.gbpb5a340+wmf1 is installed.
Found GD graphics library built-in. Image thumbnailing will be enabled if you enable uploads.
Found the Git version control software: /usr/bin/git.
Using server name "http://localhost".
Using server URL "http://localhost:8080".
Warning: Your default directory for uploads (/var/www/html/images/) is not checked for vulnerability to arbitrary script execution during the CLI install.
Using the PHP intl extension for Unicode normalization.
The environment has been checked. You can install MediaWiki.
Setting up database
done
Creating tables
done
Populating default interwiki table
done
Initializing statistics
done
Generating secret keys
done
Prevent running unneeded updates
done
Creating administrator user account
done
Creating main page with default content
done
Database was successfully set up
MediaWiki has been successfully installed. You can now visit <http://localhost:8080> to view your wiki. If you have questions, check out our frequently asked questions list: <https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ> or use one of the support forums linked on that page.
~/Documents/gerrit/mediawiki/core$ export MW_SERVER=http://localhost:8080
export MW_SCRIPT_PATH=/
export MEDIAWIKI_USER=Admin
export MEDIAWIKI_PASSWORD=dockerpass
~/Documents/gerrit/mediawiki/core$ fresh-node -env -net
# fresh: 20.02.1 (2020-02-08)
# image: docker-registry.wikimedia.org/releng/node10-test-browser:0.6.1
# software: Debian GNU/Linux 9 (stretch)
#           Node.js v10.15.2 (npm 6.5.0)
#           Chromium 71.0.3578.80
#           Mozilla Firefox 68.3.0esr
#           JSDuck 5.3.4 (Ruby 2.3.3)
# mount: /core      ➟ /Users/z/Documents/gerrit/mediawiki/core      (read-write)
#        /core/.git ➟ /Users/z/Documents/gerrit/mediawiki/core/.git (read-only)
# env: MW_*, MEDIAWIKI_*
# net: expose host

🌱  Fresh!
nobody@docker-desktop:/core$ npm ci
npm WARN prepare removing existing node_modules/ before installation

> ejs@2.7.4 postinstall /core/node_modules/ejs
> node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)


> fibers@4.0.2 install /core/node_modules/fibers
> node build.js || nodejs build.js

`linux-x64-64-glibc` exists; testing
Binary is fine; exiting

> fibers_node_v8@3.1.5 preinstall /core/node_modules/fibers_node_v8
> node preinstall.js


> fibers_node_v8@3.1.5 install /core/node_modules/fibers_node_v8
> node build.js

ignore install

> sauce-connect-launcher@1.3.1 postinstall /core/node_modules/sauce-connect-launcher
> node scripts/install.js || nodejs scripts/install.js


> puppeteer-core@1.20.0 install /core/node_modules/puppeteer-core
> node install.js


> core-js@3.2.1 postinstall /core/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

added 1064 packages in 67.269s
nobody@docker-desktop:/core$ npm run selenium

> @ selenium /core
> sh ./tests/selenium/selenium.sh

./tests/selenium/selenium.sh: 3: set: Illegal option -o pipefail
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ selenium: `sh ./tests/selenium/selenium.sh`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the @ selenium script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /cache/_logs/2020-03-18T14_39_04_456Z-debug.log
nobody@docker-desktop:/core$

Event Timeline

The pipefail feature is specific to Bash. Either we need to change the sh invocation to bash, or give up the strictness that pipefail gives us, or find another way that only uses pure POSIX features.

I would recommend against dropping the use of -o pipefail. It's one of the safeguards against the many pitfalls in writing shell scripts. It'd be better to invoke bash instead, in my opinion.

Change 580973 had a related patch set uploaded (by Zfilipin; owner: Zfilipin):
[mediawiki/core@master] Selenium: fix Illegal option -o pipefail

https://gerrit.wikimedia.org/r/580973

Change 580973 merged by jenkins-bot:
[mediawiki/core@master] Selenium: fix Illegal option -o pipefail

https://gerrit.wikimedia.org/r/580973