Commit Graph
8 Commits
Author SHA1 Message Date
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
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 e0596215e1 Fix permissions for test scripts
In https://crrev.com/c/2571462 we no longer invoke these scripts
with the locally installed Python version. However, on Unix systems,
this requires the scripts themselves to be executable.

Most of the scripts we have are already executable, but these specific
scripts were not and therefore the NPM run invocations would fail.

R=liviurau@chromium.org

Change-Id: I06bf6823aa12528ce85d9e25ba241c1cab80604a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2574459
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
2020-12-04 16:02:34 +00:00
Tim van der Lippe 8e12f92229 Use Python version bundled with depot_tools for all scripts
depot_tools ships a "vpython" binary that is added to the $PATH
for all Chromium engineers. This binary is versioned by depot_tools
which we roll in ourselves as part of `gclient sync`.

By using `vpython` instead of `python`, we are no longer depended
on the Python version installed locally and instead use the version
we pull in from DEPS.

R=liviurau@chromium.org

Change-Id: If49a54c24b6cf129ff843cd9ca1140a723a78afb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2571462
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-12-04 14:08:59 +00:00
Tim van der Lippe 88a5d76f5f Fix auto-unittest compile target
Since the inspector_overlay moved, we also moved the karma.conf.js.
However, `npm run auto-unittest` was not properly building the
karma configuration file, as that was moved into its parent
directory.

R=alexrudenko@chromium.org
CC=aerotwist@chromium.org

Change-Id: Ic74c01632fb28de6afe70e0d8555e79f97bbdb33
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2401017
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-09-09 12:01:49 +00:00
Tim van der Lippe 1dccfa6085 Do not run coverage by default for Karma
This speeds up the time for the Karma unittests to run from 26 seconds
to 4 seconds, using the default arguments. You can still obtain
the coverage report by running

```
npm run auto-unittest -- --coverage
npm run unittest -- --coverage
```

R=aerotwist@chromium.org,jacktfranklin@chromium.org
CC=bmeurer@chromium.org

Fixed: 1085426
Change-Id: I0c6be53a24223f9c9d3492143f0802ba9a15e60e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2251958
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-06-22 11:01:52 +00:00
Tim van der Lippe efb2a94cdc Run Karma unittests on the Ninja output directory
This significantly speeds up Karma execution times to about 12 seconds on an unchanged build folder.
It uses the Ninja build output to find the unittest files.

You can run the new script with:

npm run unittest
npm run unittest -- --target=Release

To make sure you perform a minimal build and run tests right after it, run:

npm run auto-unittest
npm run auto-unittest -- --target=Release

If no ninja-build-name is set, it assumes that `out/Default` exists.
The `auto-unittest` command will run autoninja for you on the output folder.

R=jacktfranklin@chromium.org,aerotwist@chromium.org

No-Presubmit: true
Bug: 1061125
Change-Id: I45edd11e422c5cdc8a4fc0bbb6bc43e386519aa9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2102717
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-04-27 10:16:15 +00:00