Commit Graph

15 Commits

Author SHA1 Message Date
Monty Taylor 0caa85cc48 Split browser and non-browser targetting js test jobs
Some javascript operations, like running tests for web-apps, need
browsers. Javascript packages that are not targetting browsers
do not.

Make a -browser version that installs the browsers and xvfb, and
a non-browser version that does not.

Change-Id: I33c12cb0d9516bdffef7d8d04af4dbcb03ed8355
2020-05-12 11:31:42 -05:00
Monty Taylor 5973c9b7b1 Extract ensure-javascript-build-tool role
The pre-playbook for the javascript jobs got complex. Extract it
to a role so we can better document it.

Also - stop installing javascript depends in pre - the depends
declared in a patch should be tested as part of the patch.

Change-Id: I50a483f223620cd3f9ecd82887062cfc9ac64b7f
2020-05-12 07:53:14 +02:00
Monty Taylor 202cce830e Add new non-npm specific javascript jobs
We have a bunch of jobs that are built around the npm role, but
for projects using yarn, that can lead to ignoring yarn.lock.

For projects with a yarn.lock, we can assume the user wants to
use yarn. Make a new js-package-manager role that can detect
if that's the case and otherwise use npm. Make an js_build_tool
parameter that allows the user to override that auto-detection.

Make a whole new suite of jobs that do this behavior, do not have
npm in their name, and default to the latest node LTS, version 14.

Don't install yarn if we're not going to use yarn. Also allow people
who want to use yarn but don't have a yarn.lock to override
js_build_tool everywhere we do that logic.

Mark the old jobs deprecated.

Shift the npm and yarn roles to use the new js-package-manager role
with defaults set.

Change-Id: I8013228ca05607a69f390a9bb75991fc6543f865
2020-05-12 07:50:19 +02:00
Mohammed Naser 6920617af5 ensure-yarn: run ensure-nodejs before
YARN needs a modern version of NodeJS and if we don't use the role
to get the latest version, we end up failing on most platforms that
ship an old version of it.

This patch also adds testing to validate that ensure-yarn alone works.

Co-Authored-By: Andreas Jaeger <aj@suse.com>
Change-Id: I83ac09bc5751c85c6f1eac550d289a300ca2255e
2020-05-01 17:07:48 +02:00
vass 0b4ed70366 Rename install-yarn to ensure-yarn for consistency
The old role will be kept and include ensure-yarn for backwards-compatability.

Change-Id: I7631c7e588bc953d6e3b22759abe66a73ffca728
2020-04-04 15:41:29 -04:00
vass ac72b44911 Rename install-nodejs to ensure-nodejs for consistency
The old role will be kept and include ensure-nodejs for backwards-compatability.

Change-Id: Ib4cf74d6c1e8774f6fc37d6a30f690eb8f9f3d08
2020-04-04 15:41:29 -04:00
vass ff44b6cd4e Rename install-javascript-packages to ensure-javascript-packages for consistency
The old role will be kept and include ensure-javascript-packages for backwards-compatability.

Change-Id: Ibb896edf0652a19be13018b4abddb4a81c51f07b
2020-04-04 15:41:29 -04:00
James E. Blair e23ece5e55 Return javascript content artifact records to Zuul
When producing javascript content tarballs, return artifact records
to Zuul.

Add a new job, build-javascript-content-tarball, which includes the
role to fetch javascript content tarballs.

Change-Id: Ia247054d0523b81916815151fd57138469f634e0
2019-06-06 06:17:47 +00:00
Monty Taylor 6d8d1a4408
Move revoke-sudo from unittest pre to job run
Having revoke-sudo in the pre playbook of unittest has made us not able
to re-use unittest for javascript, and also means we can't use
nodejs-npm for nodejs-npm-run-test, which is a bit odd.

Instead, add the role to the run playbook for tox and npm, which allows
us to stack and combine things a bit better.

Change-Id: I0c7c508996ad2647db706d4ebf156c5dd96bf9b5
2017-12-21 11:54:54 -06:00
Monty Taylor a08002fd44
Install yarn if needed in javascript jobs
Some javascript projects use yarn for dependencies instead of raw npm.
If a yarn.lock file is detected in the zuul_work_dir, install yarn and
use yarn to install dependencies.

Needed-By: I5864e1b2f9952fbc35b08ebdef348c4917564c37
Change-Id: I9ae7dd3b33b2b607c1c5a17632e2aeb12e339d15
2017-12-14 10:08:22 -06:00
Monty Taylor b125b917d9
Update javascript jobs to take npm_command variable
Similar to tox, the only difference in these is the command passed to
npm. Update the base job to do that, and the child jobs to use the
variable.

Change-Id: I5f9d420f1618e9a196b4218bca7055f377349351
2017-12-14 09:42:11 -06:00
Andreas Jaeger e2138467d6 Fix npm-run-test
The legacy test installed chromium and xvfb as well and started it,
add these back in for the run-test job.

Closes-Bug: #1731421
Change-Id: I40b7d019551c227e4b8a0e11366b1ce448d5bbed
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
2017-11-14 13:19:08 +00:00
Andreas Jaeger 560a907b06 Add npm-docs job
Add a job for building javascript documentation using Node.

Change-Id: I4517b9fb5d9b17b099e2a5ab138688caaa976be9
2017-11-09 21:31:50 +01:00
Andreas Jaeger 5e4797bda7 Add nodejs-npm jobs
Add native nodejs jobs for lint and test.

Needed-By: Ib38294ab48ef158a248637de79970ef60bc44f7f
Change-Id: I45294049d9228020b70f6b18265e21fa9385f782
2017-11-05 07:41:32 +01:00
Monty Taylor ad1ce4fc2f
Add base job and roles for javascript
This is in service of getting javascript tarball jobs going.

Change-Id: I20b4b4ce0bdf03c5585ca73471611178c94e2599
2017-10-09 08:32:45 -05:00