Commit Graph

41 Commits

Author SHA1 Message Date
Joey Parrish 7e6a0f38ff fix: Correct license headers in misc. files
This corrects/normalizes license headers in misc. files, such as
config files, docs, build tools, tests, and externs.  This does not
affect the compiled output, and is only done for consistency.

Issue #2638

Change-Id: I9d8da2de55243b08d7df2b743aac73c6f15e858a
2020-06-09 16:13:56 -07:00
Jacob Trimble 4fdf8f7a1c Allow running tests without Babel.
This greatly speeds up startup time when running tests on a modern
browser.  This change also fixes a bug in one of the tests that only
worked with Babel running.

Change-Id: I1493ef30388c5043dcdf8350bec7817ab5d28d55
2019-08-20 20:10:02 +00:00
Jacob Trimble 7226ca933a Add command-line arg to change the test timeout.
The default test timeout is 120 seconds, which makes debugging test
timeouts take a long time.  This allows changing the timeout on the
command-line.

Change-Id: Ibb27e35b9ae4b71f192841ecc6ccd90ab652b0cf
2019-07-09 17:12:13 +00:00
Jacob Trimble 716215ab38 Spell-check build scripts and fix style.
Now the spell-checking is run over the scripts too.  The spelling
regexes are stored in another file to avoid having them be caught by
the check itself (or needing to whitelist the Python file).

This also fixes another spelling error and some line-length issues.

Change-Id: Ieabef3cf3e46c6dd2cd4341dfc6c158a9d6a50ea
2019-07-09 16:40:16 +00:00
Jacob Trimble ac2df7c12a Error if trying to exclude unselected browser.
This ensures you spell the browsers correctly when excluding browsers
instead of silently ignoring badly spelled browsers.

Change-Id: I039c4a418f0e716d54daa195588890f37af3bb7a
2019-06-18 22:53:42 +00:00
Joey Parrish 3bc52546d6 Improve test output for long runs
When running the tests many times with --runs, the specifics of any
failures can be lost in the scrollback buffer of the terminal.  It can
be helpful to check the failure rate of a long test run in progress
without waiting for the final report.  To this end, this change adds
additional output to show the number of failed runs along the way.

Change-Id: I1b4c6134f35accbe19e99d72a806c70d665bef13
2019-05-22 15:43:51 +00:00
Sandra Lokshina 6b1ca2d229 Initial release of Shaka Player UI
Other contributors:
 - @joeyparrish
 - @michellezhuogg
 - @TheModMaker
 - @theodab
 - @vaage

Change-Id: If6df33d9ab5035d1ead4402004f7de37ee8470f4
2018-11-16 14:40:37 -08:00
Jacob Trimble b9dd10d8ec Propagate exit code from test.py.
Change-Id: Ie7f504213c2d332ed235409b71b3145dafce6611
2018-10-22 09:35:33 -07:00
Joey Parrish 13313b7449 Command-line to test custom assets
This will make it easier for encoder/packager vendors and other groups
to verify compatibility between Shaka Player and their custom streams.

Change-Id: I601fe4d071cef4d0bcf01b89352a61b9b9d767f0
2018-07-23 21:36:14 +00:00
Joey Parrish f48f7fd9c4 Clean up uncaught Promise rejections
- Translate uncaught Promise rejections into test failures
   (Chrome only until the event is more widely implemented)

 - Clean up uncaught Promise rejection caused by exceptions thrown
   after destroy() in:
   - CastProxy
   - CastReceiver
   - NetworkingEngine
   - StreamingEngine

 - Clean up uncaught Promise rejection caused by test cases in:
   - CancelableChain unit tests
   - DrmEngine unit tests
   - StreamingEngine unit and integration tests
   - Player unit and integration tests

 - Speed up rejection in NetworkingEngine when we should not retry

 - Add --delay-tests to test.py, to aid in debugging uncaught
   Promise rejections and other types of async test pollution

Closes #1323

Change-Id: I5a8f5702a22430929babeb071bf6650c52c5ad17
2018-02-28 22:56:12 +00:00
Joey Parrish c9f8ef7772 Resolve default browsers after parsing args
In the test launcher, it is useful to resolve the list of default
browsers after parsing command-line arguments.  This allows derived
tools to use command-line arguments to influence the set of default
browsers.

Bug: 72452551

Change-Id: I309e48fc3f0335ee6107510fe35ed2d46367e65d
2018-01-25 23:54:01 +00:00
Joey Parrish 53a7433478 Execute node module bins directly
This avoids line-length limits on Windows in the node module's
pass-through shell script.

The long list of files, combined with a node module's bin file,
tripped the Windows command-line length limit of 8k.  The transition
to eslint, therefore, broke the Windows build.

Issue #1157
Closes #1228

Change-Id: Ie57624efbbbfb4a27035e82ab12e788d18652ae3
2018-01-18 00:05:17 +00:00
Joey Parrish 37720a5ed7 Compute karma binary path after updating modules
This fixes a problem where tests fail to run after wiping out
node_modules.

Change-Id: Iec3622ef01023ed5db0f8951834d18273d848a46
2017-09-15 12:31:23 -07:00
Joey Parrish 6b46d49d2a Add "build/test.py --browsers help" to list all
Now we can snoop in the karma config and find a list of all usable
browser launchers.  This allows us to provide hints for what browsers
could be used.

Change-Id: I7116eb72957c7f8b924380c26c4c66cdca50c0bc
2017-07-31 19:19:15 +00:00
Aaron Vaage 4496f53f75 Resolve TODO in build/test.py
There was a TODO left in build/test.py to resolve function names
that are used across files.

Change-Id: I34b4d5338082733b7424f446cef51f5a0293fd4f
2017-07-26 13:18:47 -07:00
Aaron Vaage fe5706c74e Made build/test.py arguments consistent
Have you heard? The build/test.py arguments have been driving people
crazy, yes, CRAZY. To help cure the out-of-control insanity that is
sweeping the nation, I have taken our build/test.py and karam.conf.js
scripts and changed how they process command line arguments.

For build/test.py we are now using argparse (standard python library)
to parse the command line arguments. From there we build a JSON
object that is passed to Karma. This allows all command line parsing
to be done in Python and then our Karma conf only needs to read
the settings out of an object.

Fixes: 34107973
Change-Id: Iad631ca18778a031c7ce8bb613c52449069868e3
2017-07-26 17:16:54 +00:00
Aaron Vaage 6bc354a75a Revert "Made build/test.py arguments consistent"
This reverts commit c950647fdf.

Reason for revert: Reverting this for now as it breaks cross_browser.

Change-Id: I8a2b6bfa007e37674bc2c435fe2fa863ae77a824
2017-07-18 19:55:45 +00:00
Aaron Vaage c950647fdf Made build/test.py arguments consistent
Have you heard? The build/test.py arguments have been driving people
crazy, yes, CRAZY. To help cure the out-of-control insanity that is
sweeping the nation, I have taken our build/test.py and karam.conf.js
scripts and changed how they process command line arguments.

For build/test.py we are now using argparse (standard python library)
to parse the command line arguments. From there we build a JSON
object that is passed to Karma. This allows all command line parsing
to be done in Python and then our Karma conf only needs to read
the settings out of an object.

Bug: 34107973
Change-Id: I22f35a4f9bc89cda0d4a07ff030efa6e22467ba3
2017-07-18 17:55:01 +00:00
Jacob Trimble fddcf0c259 Use logging module over print.
Rather than using print, use the logging module.  This allows embedding
environments to setup logging how they want.  This also ensures the logs
are flushed properly.

The prints for check.py, checkversion.py, stats.py, and for the --help
flag will still be printed to stdout since that would be the expected
output location.

Change-Id: I26e1bc866803c42981628c7e62261d13c7b3ff2b
2017-05-10 21:25:39 +00:00
Joey Parrish 1e0ad7126f Update shebang lines of python scripts
/usr/bin/env python is preferable, since it allows us to support
executable scripts on systems where python is installed in places
other than /usr/bin.

Incidentally, this was the only thing I needed to do to confirm
full build support on Windows, so I'm dropping a TODO about Windows
support for the extern generator.

Change-Id: Ice93174428e0d8015d0a7787f07a17e8ac808dc7
2017-04-24 20:17:43 +00:00
Jacob Trimble 8cdc41ef16 Only update npm and build once when using --runs.
Change-Id: I7e8bec20f2e1cf0bf2d9043c20eab632606c7c05
2017-03-09 14:40:33 -08:00
Jacob Trimble dfa356b7d9 Print error when missing dependencies in build scripts.
When a program (e.g. Java) cannot be found in the build scripts, it
will now print a more specific error message and quit early to avoid
other confusing messages.

Change-Id: I5f1f26a6c05b8db45355bfbc8d799d603c80c55c
2017-01-11 18:14:28 +00:00
Chad Assareh 5a46cde217 Add command line option for running tests with xvfb.
Change-Id: If24ca02870b5a787afa1fc3bc086a83b0ffaddbe
2016-12-09 17:07:04 +00:00
Chad Assareh 068f32d8ed Add command line option for running the tests multiple times.
Change-Id: I69d70a24ad3008bed4e8045d2c5156936b3460f7
2016-12-09 17:05:07 +00:00
Jacob Trimble 1e5dc5cc14 Fix build scripts for Windows.
* Node binaries should have .cmd appended to file name.
* htmlhint cannot find .htmlhintrc file.
* Use same python environment for subprocesses.

Closes #526

Change-Id: I6b4c898b39a3e2eb8d808feb2b46b79fba5dc455
2016-09-20 14:01:42 -07:00
Jacob Trimble a1449e44dc Make build files consistent with Google python style guide.
Change-Id: I49d181c4dbe4fe12b73cdc4a5c78b3dcf1319b56
2016-06-28 22:30:30 +00:00
Jacob Trimble a8f83e91b4 Disallow fit/fdescribe in tests
Add an argument to not build when running tests.

Change-Id: Ia2f4045eb196cad94d0228a9d3b462b88f16466b
2016-04-25 23:48:20 +00:00
Chad Assareh da24460a9c Update build/all.py and build/test.py to pass --force when specified.
Fixes "No changes detected, not building.  Use --force to override." when
executing build/all.py and build/test.py with --force.

Change-Id: Ib230b5b21d4f10fa67dd686c90124f51f2b585d4
2016-04-19 18:18:08 +00:00
Joey Parrish e325d031e6 Print progress during all build steps
Change-Id: I3e41f1a88cf4d866125c8e62cdb769d6dc2164c6
2016-04-06 13:40:49 -07:00
Jacob Trimble 18849bf6a6 Detect and print error for unsupported npm versions.
On versions before v1.3.12, 'npm update' appears to do nothing and
and returns success.  This causes the tests to fail if the node
modules are not installed yet.  Now it will detect the npm version
and print an error message if it is unsupported.

Closes #318

Change-Id: Iff1db8a6f85d5ce705e5504ee9cb23d2246b87c3
2016-04-05 18:34:20 +00:00
Jacob Trimble d7fb07ea7e Fixed a bug in the test script.
A previous change to remove a variable missed a usage.  Fixed it
and removed an unused variable.

Change-Id: I899583a32c8ff4971b020413f7666de79d05da1a
2016-03-28 14:51:17 -07:00
Joey Parrish 7433b47c2a Player integration tests
Tests all demo assets through the compiled library.  To debug,
use --uncompiled to run them with the uncompiled library.

These new tests are off by default because they use external assets
and run very slowly.  Use --external to run these tests.

Change-Id: If1648108dbb9a323d59f6b0e14b4fe6c446a90d2
2016-03-23 19:00:10 +00:00
Joey Parrish 6c000192d7 Expand WebDriver browsers
This expands our list of browser targets using WebDriver and drops
the BrowserStack targets.  We will no longer be using BrowserStack.

This also drops xvfb-run for Linux.  As we move toward testing
primarily over WebDriver, the overhead of starting an Xvfb is not
necessary.

Change-Id: If2dd26caf3dea88ba39c20644f329451de48c273
2016-03-16 15:41:08 -07:00
Jacob Trimble 19973d63f4 Changed copyright headers from 2015 to 2016.
Change-Id: I429ff27e4794c03b7ea392e38415075077f9bfb1
2016-03-15 16:32:13 -07:00
Joey Parrish 9f67725a1e Do not run coverage reports on every test
The tests take so long now that re-running for coverage should not be
automatic.

Change-Id: If70f9af308348284bcc98c0a0fc2773d7a8c8a59
2016-03-10 23:18:56 +00:00
Joey Parrish 11ad4f7699 Update modules before running tests
Change-Id: I7039418a0a27de56b0f452800c90eebc084d814c
2016-03-10 18:01:51 +00:00
Chad Assareh 1c82f75786 Adding webdriver browsers to karma conf.
Change-Id: I2f2a93aca79d44bc4051195260011ef4c9643e13
2016-02-19 22:23:25 +00:00
Joey Parrish 72ad7add2f Refactor karma startup
Remove the need for --single-run and simplify how the karma command is
found and how the command-line is built.

Change-Id: Ic926219e3100ff043289a1c5f0c224a517b0188e
2016-02-08 13:31:40 -08:00
Joey Parrish 10e286b878 Firefox stable no longer needs special config
Firefox stable now supports MP4 on Linux with default flags.
This also updates comments on Firefox and Opera in build/test.py.

Change-Id: I2b7d1696c390f775576a5cca0a24197f8d7f2915
2016-02-05 12:05:34 -08:00
Joey Parrish 1ed734df4d Prefer locally-installed node modules
If a user has locally-installed node modules, they should take
precedence over any global installation.

Change-Id: I5b58d910a45d9640146fc8126bbd6ccb7cc43ff6
2016-02-05 11:44:26 -08:00
Jacob Trimble 92075fbc29 Replaced remaining build scripts with python.
This also makes all build scripts runnable on Windows using both
Cygwin and native python.

Change-Id: If324800b8b899cac1cc715d30383255cd5f6ee71
2016-02-02 00:37:42 +00:00