Commit Graph
193 Commits
Author SHA1 Message Date
Jack Franklin 2662479c79 Enable npm run auto-e2etest to take a target
This CL updates the run_test_suite.js script to support the --autoninja
flag alongside --target, in which case it will do a build before running
the tests.

Unfortunately I had to duplicate the package.json entry, else we get
into a world of confusion with passing command flags through npm run
commands, and I couldn't get it to work.

Bug: none
Change-Id: I0a339c72cf41a4ffcb0241e8b3efb1b35b2e5a9f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4684353
Reviewed-by: Andres Olivares <andoli@chromium.org>
Commit-Queue: Andres Olivares <andoli@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2023-07-14 12:22:49 +00:00
Al Muthanna Athamina 21696bda6d Add shuffle option to e2e_divider
Bug: 1419802
Change-Id: I54d001c315633304623825331cbba540f1e0f064
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4647595
Auto-Submit: Almothana Athamneh <almuthanna@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Almothana Athamneh <almuthanna@chromium.org>
Commit-Queue: Danil Somsikov <dsv@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
2023-06-28 11:40:30 +00:00
Al Muthanna Athamina 8719882ebf Prettify local parallel E2E test results
Bug: 1419802
Change-Id: I98c10a89bfe9d1f9147474ab2ba3396acb92b483
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4628410
Commit-Queue: Almothana Athamneh <almuthanna@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Auto-Submit: Almothana Athamneh <almuthanna@chromium.org>
Commit-Queue: Danil Somsikov <dsv@chromium.org>
2023-06-20 15:49:02 +00:00
Al Muthanna Athamina e234a4f9f6 Add scripts to split the e2e tests command and a local parallel runner
This adds two scripts: one that divides the E2E tests command into
multiple ones that can be run separately, and another script that runs
these commands in parallel Python processes. This will allow us to run
the E2E tests locally but it is also necessary for running tests in
parallel on the builders. We also remove skipOnParallel since it is
not needed anymore.

Bug: 1419802
Change-Id: I7e4c2a6f1847c3a63cab1cc2365ddaa69b77f2fb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4543009
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Almothana Athamneh <almuthanna@chromium.org>
2023-06-14 10:40:19 +00:00
Alex Rudenko df848bd08e Fix platform check in checkGoldensForPlatform
There is a win in darwin.

Bug: 1440943
Change-Id: Ic9fa6cacc074d77be5bd5f58bed3359613d8c410
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4497908
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2023-05-02 09:05:55 +00:00
Andrés Olivares 10417e7ccb Export merged results of unit and interaction test coverage as text file
For convenience, since the bots will still use the JSON file.

Also, an option to define the folders on which coverage will be
calculated is added to the interaction tests. The flag works
identically to the COVERAGE_FOLDERS of unit tests, i.e. a pattern is
provided to define the included folders. For example: the flag can be
set like COVERAGE_FOLDERS=
front_end/{models/trace,models/timeline_model,panels/timeline}

These two changes should help to calculate the total OPP coverage in
go/opp-test-coverage

Bug: 1424729
Change-Id: Ie982f62dfac0014c05075e53173a8e7710d3b9e0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4345493
Commit-Queue: Andres Olivares <andoli@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2023-03-20 09:39:59 +00:00
Al Muthanna Athamina bdc5f4027c Add skipOnParallel to it and invert flag
With skipOnParallel we can skip tests when running in parallel and run
them separately in a sequential way with fgrep. We also added the
invert flag (which allows us to invert fgrep) in case we need it in
the future.

Bug: 1419802
Change-Id: I2cd479f476b0c3ef2b0c204d49bdd9da535397a9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4315959
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Adam Raine <asraine@chromium.org>
Commit-Queue: Almothana Athamneh <almuthanna@chromium.org>
2023-03-13 15:04:14 +00:00
Al Muthanna Athamina 40d1b8a912 Add parallel execution command for E2E testing
Bug: none
Change-Id: Id5a960dfb19aa3629a44f8d4a5e874551cf2e1b0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4274348
Commit-Queue: Almothana Athamneh <almuthanna@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Liviu Rau <liviurau@google.com>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
2023-02-23 10:57:26 +00:00
Andrés Olivares 205bf68542 Check for obsolete screenshot test goldens on PRESUBMIT
Porting the internal script to devtools-frontend. Folders are created for each platform to prevent file not found errors.

The implementation is almost identical to the internal version, except:

  - Support for windows presubmit bots, on which this didn't run before.
  - Interactions root folder is passed as an argument to the script.

Bug: 1407638
Change-Id: Ia373ad258071cdcc0f7e5b417fcc2301d43084ce
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4207837
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Andres Olivares <andoli@chromium.org>
2023-02-01 12:59:59 +00:00
Jack Franklin c8d5dd2e7c Apply JSDoc alignment rule to scripts/ directory
I mistakenly applied this rule only to `*.ts` files, but we should apply
it to JavaScript files also.

Bug: none
Change-Id: I6c7af0e897e06a7a04ec3dea83fcbd9719744705
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4111459
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Andres Olivares <andoli@chromium.org>
2022-12-21 16:26:37 +00:00
Jack Franklin 0752134a5d Add --log-level to unit tests.
This CL adds a `--log-level` flag to the unit test runner that will
allow the log level to be configured. This flag is passed right through
to Karma, but is also respected by the logs output by our test runner
before initialising Karma.

The default value for `--log-level` is `info`, so this CL doesn't change
the built in functionality; but you can now pass `debug`, `info`, `warn`
or `error` to configure it.

Bug: none
Change-Id: I82006a1a8283c3d93389f124317a37bac69b5038
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3963112
Commit-Queue: Thiago Perrotta <tperrotta@chromium.org>
Reviewed-by: Thiago Perrotta <tperrotta@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-10-18 14:14:35 +00:00
Eric Leese ed8fe6a3c5 UI polish for authored/deployed grouping
Bug: 1334536
Change-Id: I97a45377ec48f4852e792925771b0790a0415311
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3695547
Reviewed-by: Victor Porof <victorporof@chromium.org>
Reviewed-by: Jecelyn Yeen <jec@chromium.org>
Commit-Queue: Eric Leese <leese@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2022-06-09 16:00:02 +00:00
Jack Franklin 38391d47f5 Land --no-fix flag to ESLint runner
This is useful sometimes if debugging a new ESLint rule - I've found
myself manually updating the script to disable fixing whilst I figure
something out.

Adding this flag and a separate `lint-check-js` script will make this
easier.

Bug: none
Change-Id: I929b13b09ece40690d630620da162986ed01e790
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3605263
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-04-25 13:00:57 +00:00
Jack Franklin 40a72b0ca0 Remove run_lint_check_js.js
We have run_lint_check_js.mjs which is used in PRESUBMIT, package.json
and on the bots. I think we just forgot to delete the old version.

Bug: none
Change-Id: I91179c3d30c306968774981678a044f3249c1d18
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3598880
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-04-22 08:22:47 +00:00
Alex Rudenko d990ae300a Improve handling of .spawnSync errors
Fixed: 1198532
Change-Id: Id299bb7700f7a78aad97ad77eee23e4bd0c5b5f7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3598878
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2022-04-21 15:37:27 +00:00
Liviu Rau b9d36166b6 Migrate to py3
+ drive-by imports cleanup

DISABLE_THIRD_PARTY_CHECK=Migrating multiple scripts to py3
Bug: 1292013
Change-Id: Ie81765366236bd6f6213075de3d529afe21d561f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3521887
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
2022-03-15 13:19:16 +00:00
Jack Franklin a08500377b Add --mocha-fgrep to unit tests
This CL adds the ability to run:

```
npm run auto-unittest -- --mocha-fgrep=breadcrumb
```

To the Karma unit test suite to mirror the similar flag available in the
interactions and e2e test runner script. This is also why it's named
`fgrep`, as that's the same flag as used in the other script, and we
should be consistent.

Bug: none
Change-Id: Ic119f7186e0e97c83e00bf92a66d69181c931a8b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3452723
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-02-11 09:55:47 +00:00
Jack Franklin 7a9e4e9b2c Support --mocha-reporter-options in run_test_suite
I landed support for Mocha's `--reporter` flag but you also need
`--reporter-options` to be able to configure them fully.

Bug: 1278289
Change-Id: I8c46bc1e9dfd87ed22edd04d60e906b622364232
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3327249
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2021-12-10 10:53:01 +00:00
Jack Franklin 3d57faf4fe Support --mocha-reporter in run_test_suite.js
So that we can generate JSON reports from test runs.

Bug: 1278289
Change-Id: I8450280297102154a36fd9698f6cb05a76899103
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3327242
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2021-12-09 14:50:06 +00:00
Tim van der Lippe f9e565ef89 Add new run_lint_check_js.mjs
ESLint 8 removed CLIEngine. Therefore, we need to migrate away from
CLIEngine to the main ESLint class (which already exists in ESLint 7).
However, that class is based on promises, which means we can't use them
in a CommonJS context.

Therefore, introduce a new `.mjs` version that uses ES modules (which
can do as we are on a recent version of Node) and use the promise
versions. There are no other functional changes compared to the old
`.js` script.

The reason that we first have to add this file here, is that our CQ
directly refers to the `.js` version. That means we first land this CL,
we update our CQ configuration and only then can we remove the `.js`
file from our repository.

R=jacktfranklin@chromium.org

Bug: none
Change-Id: Iad3656931ae09eb7f9f23b3e6ad7d39c8a761a31
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3268299
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2021-11-09 10:25:30 +00:00
Jack Franklin d9172b6d0c Reland "Add mocha-fgrep flag to run_test_suite.js"
This relands the original change with a fix to avoid the issue where
we'd run Mocha with `--fgrep=undefined`, causing no tests to run...

Bug: none
Change-Id: I4df53a935fe5c4359e5c35f56db4f9c133e7603f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3162062
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-09-15 16:04:20 +00:00
Jack Franklin 634ddfed43 Revert "Add mocha-fgrep flag to run_test_suite.js"
This reverts commit 348a89db15.

Reason for revert: broke interaction and e2e test runs

Original change's description:
> Add mocha-fgrep flag to run_test_suite.js
>
> This CL adds the ability to filter the tests via Mocha's `fgrep` flag,
> giving us the ability to run a subset of the tests if we wish in the
> future.
>
> Fixed: 1249000
> Change-Id: I3379f6f0f60fc97d8af6b019761cfb31dda8afd2
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3162297
> Reviewed-by: Paul Lewis <aerotwist@chromium.org>
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>

Change-Id: Ie1e1999f60f3b144665083e0103a786cfb22906e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3162060
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-09-15 14:35:50 +00:00
Jack Franklin 348a89db15 Add mocha-fgrep flag to run_test_suite.js
This CL adds the ability to filter the tests via Mocha's `fgrep` flag,
giving us the ability to run a subset of the tests if we wish in the
future.

Fixed: 1249000
Change-Id: I3379f6f0f60fc97d8af6b019761cfb31dda8afd2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3162297
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-09-15 11:53:07 +00:00
Jack Franklin 6584d42b63 Add deprecated note to run_test_suite.py
Bug: chromium:1186163
Change-Id: I03a271c232f1f4fdf9f33682d75520f39b593af1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3121429
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-08-26 11:16:14 +00:00
Alex Rudenko f1182e24da Fix missing os import in run_test_suite.js
Probably broken in crrev.com/c/3080314

Bug: chromium:1186163
Change-Id: I0478b7f137d80e1a1aad13e81579c1cc67b40cdf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3083705
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-08-10 07:01:00 +00:00
Jack Franklin 841587771d [TestRunner] allow --node-modules-path to be multiple paths.
Bug: chromium:1186163
Change-Id: I63a88cc94403983b1cead1d8ac54bc04469e1b03
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3080314
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-08-09 16:03:08 +00:00
Jack Franklin 9f22436c08 Revert "[TestRunner] remove run_test_suite.py"
This reverts commit 92000f342d.

Reason for revert: broke some places where we still rely on this script

Original change's description:
> [TestRunner] remove run_test_suite.py
>
> The CQ bots all run run_test_suite.js, and all our local `npm run X`
> scripts have run run_test_suite.js for many months now. I think we are
> now safe to remove the Python run_test_suite.py script, as all use cases
> are covered by the new JS runner.
>
> Bug: 1186163
> Change-Id: Ie8b5fd52e0934176a7da61d61fb9624b87ed764b
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3075181
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>

Bug: 1186163
Change-Id: I12505c1bc0c98c81b1de3c242f1ab7f234e6e06d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3080311
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
2021-08-09 13:44:47 +00:00
Jack Franklin e716e01269 Allow run_test_suite.js not to run a server
This CL updates run_test_suite.js to allow the user to explicitly pass
in `none` for the test server type, rather than currently where the
runner basically forces you to run either the hosted mode server or the
component docs server.

Bug: chromium:1186163
Change-Id: Ib01f31f3f7ccfb4956c0c42a8deed035454e0d84
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3080310
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-08-09 13:32:27 +00:00
Jack Franklin d2a117c50f Remove lint-components-css script
Now we ban CSS in web components, this script is irrelevant as it'll
never find any issues - and we lint to ensure no style tags creep into
our Lit templates.

Bug: 1106746
Change-Id: I507193c63a1ab26901d9d3aaec2b01620717b477
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3075380
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-08-06 18:02:47 +00:00
Jack Franklin 92000f342d [TestRunner] remove run_test_suite.py
The CQ bots all run run_test_suite.js, and all our local `npm run X`
scripts have run run_test_suite.js for many months now. I think we are
now safe to remove the Python run_test_suite.py script, as all use cases
are covered by the new JS runner.

Bug: 1186163
Change-Id: Ie8b5fd52e0934176a7da61d61fb9624b87ed764b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3075181
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-08-06 10:17:47 +00:00
Jack Franklin 2c388ffbc6 Remove legacy run_test_suite.py code
This CL tidies up some leftover TODOs that we can now safely do now we
have fully migrated to run_test_suite.js.

Bug: chromium:1186163
Change-Id: I87a7e6052934e7ae0a4c5758dae2229703362242
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3075197
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-08-06 10:16:46 +00:00
Jack Franklin 98edce7f17 [TestRunner] fix bug setting configuration flags
Once we've got the `yargsObject`, we pull out all the keys we want,
which are all the configuration flags bar the special yargs keys `$0`
and `_`. The bug here was that once we pulled out that configuration, we
didn't update it, and instead kept referring to `yargsObject` in the
rest of the code. This meant that when we dynamically set the
`test-server-type` flag, we set it on `yargsObject`, but we needed to
set it on the configuration flags object so that the settings propagate
down into the test runner.

Bug: chromium:1186163
Change-Id: Ia88bb25588651fac4c11783f551651d27ccd0334
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3075379
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-08-06 01:23:16 +00:00
Tim van der Lippe a53672de83 Check license headers for CSS files during PRESUBMIT
This mirrors the license header checks we perform for
Python-like files and apply the same logic for CSS.

To do so, we modify the relevant regexes and patch
function to use the correct version of comment structure
for CSS files (which use `/*` rather than `#` as delimiters).

R=jacktfranklin@chromium.org

Bug: 1106746
Change-Id: I51d51e9b793a1015aeb20a3b3a55e075c2ee748f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3014756
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-07-13 12:28:56 +00:00
Alex Rudenko fd136e001e Rename DEBUG env var to DEBUG_TEST
Currently, you cannot run tests in non-debug mode
and turn on debug logging from Puppeteer that relies
on https://www.npmjs.com/package/debug.

Running `DEBUG=puppeteer.* ...` would also start the
test runner in a debug and non headless mode. This
CL renames the DEBUG variable that DevTools test runner
relies on so that debug logging is independent from the
debug mode we have for tests.

Bug: none
Change-Id: I8b8476f7c26c07eea1db29bfae74d4fb61afd42c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2963755
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2021-06-16 12:47:15 +00:00
Tim van der Lippe 8b929548c0 Also add license headers for .gni files
R=jacktfranklin@chromium.org

Bug: 1213449
Change-Id: I3228629bbaa1c3824a721a93782356ec71855513
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2919951
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-05-26 16:19:23 +00:00
Tim van der Lippe 81752507db Integrate license header check in PRESUBMIT
Also fix the script to only allow absolute paths, since the presubmit
script handles absolute paths only.

R=jacktfranklin@chromium.org

Bug: 1213449
Change-Id: Id1c0c55ec1c039eadd343445645655910b06da8c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2919950
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2021-05-26 15:06:53 +00:00
Tim van der Lippe 1dc9ecb63c Add script to check license headers for BUILD.gn files
The script currently processes all BUILD.gn files in the
top level directories and automatically adds the required
license header if missing.

In a follow-up CL the script will be integrated in the
PRESUBMIT.py.

R=jacktfranklin@chromium.org

Bug: 1213449
Change-Id: Ifea17b0fd3301158c098513d0cc9d7d7c50e3fe3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2919948
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-05-26 14:38:55 +00:00
Jan Scheffler 0f14e2b82c [Unit tests] Show html coverage results location
This cl informs developers where they can find the result when running
unittests with the html coverage report enabled.

Bug: None
Change-Id: Id6784d9070fc2ad1f1be2a1da58b0d5baf174f8a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2912102
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-05-25 08:58:53 +00:00
Jan Scheffler ef7787df1a [Unit tests] Improve output for unit tests
This change replaces the 'spec' report with a 'mocha' report in karma
when the '--expanded-reporting' flag is set. If it is not set and the
tests fail, a hint is added to the console to enable the flag to get a
more verbose output of why the tests are failing.

Bug:None
Change-Id: Ia41615362332459a4d89aef0440cea0ec266157b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2912098
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
2021-05-25 08:26:23 +00:00
Tim van der Lippe 7460028f70 Update run_test_suite to pass on coverage flag
When running `run_test_suite.js` you can now specify `--coverage`
to allow for coverage collection. This will used by the CQ
scripts to collect coverage for interactions tests.

R=jacktfranklin@chromium.org
CC=liviurau@chromium.org

Bug: 1206705
Change-Id: I555662f02efbf16165f1c8b3e47403e427d65a0a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2884241
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2021-05-11 09:29:08 +00:00
Tim van der Lippe baa6dec654 Add script to merge unit and interaction test coverage
This script can be invoked to obtain the coverage from the unit
and interaction tests and writes them to a coverage-summary.json
file that lives in `test/`. This file can then be used in favor of
karma-coverage/coverage-summary.json to upload to the Chromium
infrastructure.

As a follow-up, we should turn on coverage collection on CQ and
hook up this script after both unit and interaction tests have
completed.

R=jacktfranklin@chromium.org
CC=liviurau@chromium.org

Bug: 1206705
Change-Id: I52199940d6747ec13f208233e04dcf81a618a8fb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2884240
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2021-05-11 09:19:48 +00:00
Tim van der Lippe e622f55864 Move component_docs to ui/components/docs
R=jacktfranklin@chromium.org

Bug: 1187573
Change-Id: I2f8225ba1b9fc9848cf497ec0235756ace0f4831
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2826290
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-04-14 15:08:31 +00:00
Jack Franklin 95126a863b [TestRunner] support --test-file-pattern as a positional arg.
Bug: chromium:1186163
Change-Id: Ib485321ba38860b9640f143f5cba008bdfa52bf6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2794955
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
2021-03-31 12:18:13 +00:00
Jack Franklin e61c02b806 [TestRunner] Make Conductor use --chrome-features flag.
This CL fixes a bug where the test runner took the `--chrome-features`
flag but Conductor never read that value when booting up a browser
instance.

This CL updates it so it will read the value and pass it into the
relevant argument when executing `puppeteer.launch`.

I also changed the Python test suite runner to not prepend
`--enable-features`; that feels like something that Conductor should
do, not the test runner.

Bug: chromium:1186163
Change-Id: I05916d39d60bb98a606570cd82e688581dd78a40
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2790874
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-03-29 11:47:41 +00:00
Jack Franklin 4b34d9c8cf Revert "[TestRunner] remove --chrome-features flag"
This reverts commit 7742a201a1.

Reason for revert: We do have a use case for this flag that we missed, so we need it. Will follow-up with a CL to fix the fact that the test frontend infra doesn't use it currently.

Original change's description:
> [TestRunner] remove --chrome-features flag
>
> The scripts (both the old Python one and the new JS one) took
> `--chrome-features` as a flag, which was then set as
> `process.env.CHROME_FEATURES`, however searching the codebase for
> `CHROME_FEATURES` revealed that whilst we set this value, we never
> read it. Therefore this CL removes it entirely, my logic being that if
> someone needed this flag to work, we would have found this bug a long
> time ago.
>
> We can reintroduce should we find a usecase for it in the future.
>
> Bug: chromium:1186163
> Change-Id: I11d900df4aaad232fd64b9edca2aac12c94fc988
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2782555
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>

Bug: chromium:1186163
Change-Id: I336a4a14a3e720f3b0626d78148038ceab9a8774
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2786942
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-03-25 14:02:21 +00:00
Jack Franklin 7742a201a1 [TestRunner] remove --chrome-features flag
The scripts (both the old Python one and the new JS one) took
`--chrome-features` as a flag, which was then set as
`process.env.CHROME_FEATURES`, however searching the codebase for
`CHROME_FEATURES` revealed that whilst we set this value, we never
read it. Therefore this CL removes it entirely, my logic being that if
someone needed this flag to work, we would have found this bug a long
time ago.

We can reintroduce should we find a usecase for it in the future.

Bug: chromium:1186163
Change-Id: I11d900df4aaad232fd64b9edca2aac12c94fc988
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2782555
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
2021-03-24 15:26:05 +00:00
Jack Franklin 1e39e4a268 [TestRunner] allow the e2e resources path to be configurable
Bug: chromium:1186163
Change-Id: I35031bd570f88de3b884da4e57cb9de5d00e5571
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2782551
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2021-03-24 10:58:21 +00:00
Jack Franklin fa099cbaef [TestRunner] validate file paths on input
Bug: chromium:1186163
Change-Id: If1c73edeebc1e015314ed4250ef038a816bdbcf4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2780793
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-03-23 11:28:59 +00:00
Jack Franklin a3dd06a3de Add test-suite-source-dir flag to new test runner
The current tests try to figure out the root directory and then glob
for _test.ts files within there, but this breaks easily if the folder
structure isn't exactly as expected. Instead we can set this via a
flag in the test runner.

This CL only updates the interaction tests, which use the new runner.
e2e tests will be supported in time.

Bug: chromium:1186163
Change-Id: I198b67bf0081ce7334c40d7d661fb8642c2d56d0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2772045
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-03-18 11:19:17 +00:00
Jack Franklin 0e199ca69f [TestRunner] set test-server-type flag
This CL adds a flag to the new test runner to provide the test-server-type.

We intelligently set it if the test suite ends with `e2e` or
`interactions`, but otherwise it's required. Unfortunately this can't
be checked as part of Yargs' API, so we check for it ourselves at run
time.

Bug: chromium:1186163
Change-Id: I6487f1a95c6c86759e1489309d4c18aec1292073
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2767266
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-03-18 11:04:22 +00:00