- Updated tox envlist, so just running `tox` from the CLI will now run all
voting gate tests
- Reduce duplicated definitions and commands
- Remove any reliance on run_tests within tox
- Removes all doc references to run_tests.sh, and replaces them
with their tox equivalent. Where necessary, language around the tox
commands has been altered or extended so that it makes sense and is
consistent with other parts of the docs. Also adds a new "Test Environment"
list to the docs, so that newcomers do not have to piece together CLI
commands and their cryptic extensions from tox.ini
- Move the inline shell scripting to its own file. Also fixes a bug when
passing args, since the logic assumed you were attempting a subset test
run (try `tox -e py27 -- --pdb` on master to compare)
- Moved translation tooling from run_tests to manage.py, w/ help text
and arg restrictions. This is much more flexible so that plugins can use
it without having to copy commands, but still defaults to exactly the
same parameters/behaviour from run_tests. Docs updated appropriately.
- Removed npm/karma strange reliance on either .venv or tox/py27. Now
it only uses tox/npm.
Change-Id: I883f885bd424955d39ddcfde5ba396a88cfc041e
Implements: blueprint enhance-tox
Closes-Bug: 1638672
Updates to newer versions. We should test this and release it early in the
Newton cycle.
Change-Id: Ia1f0c414c75d9a2bf860da7cdf85886b54d401f4
Closes-Bug: 1582912
This patch upgrades eslint to version 1.2.4, incorporating new rule
changes on no-undefined, brace-style, quote-props, space-in-parens,
no-use-before-define, no-uneeded-ternary, and quote.
For now, rules that have been activated that cause checks to fail
have been switched to warning-only. Additionally, rules that
have been entirely disabled have been removed.
Change-Id: Ifba7a19da669288cb19cfc8055bdfa7b94f00292
A lot of the JavaScript dev dependencies are quite outdated. This patch
updates them.
Closes-Bug: 1569783
Change-Id: I8b47e573a3a3160c824e21f6865b5e9af32c8d64
PhantomJS has setup issues and is slowing down the gate with false
failures. We should change to Chrome until Phantom is more
reliable, at which point this patch can be reverted.
Change-Id: I4bf1c1e8e26ac708bd35145aff98562f30b3a050
Closes-Bug: 1568325
bumps the eslint version to 1.10.3 which fixes a lot of
issues, especially rules not working as expected
or being ignored and brings the js code up to date to
comply with those rules.
Change-Id: I1234e7991f98d4ceb0c5333dc036c6a30206ff64
We have a ton of warnings. This makes it difficult to locate linting errors.
This patch adds an npm script for developers to run eslint in quiet mode
with color.
Change-Id: Ie1ecc201d025c428d15b310b78e9c343a341aed3
Closes-Bug: #1546736
eslint-plugin-angular in use by the project is
quite old and the new library has changed rules.
This patch updates the library and fixes the code
where rule names have changed.
Change-Id: I2e60a07b899325f17f38b96d40325602b4b58219
Closes-Bug: #1527417
This updates eslint-config-openstack to 1.2.3, and downgrades the
new rules so we can tackle them one at a time.
Change-Id: I3d7a20a6141a8748a60ceefcd33a1310456302dd
The newer version of eslint comes with somewhat stricter rules
about indentation and whitespace, so some files have been
adjusted to accomodate.
The newer version of eslint-config-openstack includes a relaxed
version requirement for eslint, as well as a switch/case
indentation update.
The newer version of the angular eslint rules includes a
deprecation rule for $cookieStorage, which has been set to
warning.
Change-Id: Id201a42e3ab484222f938a541507df2e96da2dcf
Partially-Implements: blueprint jscs-cleanup
The file glob pattern in package.json
*/static openstack_dashboard/dashboards/*/static
has been changed to openstack_dashboard/static and
horizon/static as only then does it run lint on the
openstack_dashboard folder.
Fixed issues in files in openstack_dashboard that
have unaddressed warnings.
Change-Id: I1ae1346281f028821afae159d471e3e87b2d8d6d
Closes-Bug: #1490704
Recently, some Javascript files changed locations from
"openstack_dashboard/static"
to
"openstack_dashboard/dashboards/identity/static"
and
"openstack_dashboard/dashboards/project/static"
This changes the lint task to add these directories
Change-Id: I6ceeaacd1c4e1774b7279c5cc2610a583db58b5d
Closes-Bug: #1485885
This patch adds unit test coverage threshold reporting, adding
statement, branch, function, and line coverage to the console
output in infra, and failing the build if the threshold has not
been met.
The threshold values have been set to the current observed
coverage values - future patches should update this up as
coverage improves.
Closes-Bug: 1487109
Change-Id: Ie83ebf5d976b3538e3528787b05de3e83df18af8
Instead of explicitly copying all the linting rules between projects,
openstack now publishes a set of rules (much like hacking) that can
be included in projects that want to adhere by our standards. This
patch switches horizon to use this set of rules.
Note: The rules in eslint-config-openstack are a verbatim copy
of what's currently in use in Horizon. Future versions will likely start
activating rules flagged as "TODO", however you can avoid build
instability by avoiding the use of fuzzy version matching in
package.json (which this patch does).
Change-Id: Ib93e0def096999ece7f636d028e3b1ecd4a4facc
This patch switches horizon from using JSCS to using ESlint. It
adds the john papa style guides as an eslint plugin, and deactivates
additional linting rules so current cleanup efforts can focus on the
issues remaining from JSCS. Once that cleanup effort is complete,
we can switch our linting job to voting and move forward from there.
YAML for .eslintrc was chosen because the JSON specification does
not allow comments, and having comments (including rule links) will
make it easier to discuss linting changes.
Deactivated eslint rules have each been annotated with a # TODO
statement, so we can address them in the future. Links in the
documentation have been updated to new contributor guidelines, which
will be updated after this patch lands.
Linting may be executed by first installing npm dependencies using
`npm install`, and then executing `npm run lint` at any time in the
future. No python venv is required.
For clarification: We are switching to ESLint because JSCS explicitly
focuses on code-style, not on language use errors. For that purpose,
JSCS explicitly defers to JSHint, which due to the 'do no evil' license is
not usable. Since ESLint provides both the codestyle functionality, and
the language use checks, of both JSCS and JSHint, it was deemed the
only viable tool,
http://lists.openstack.org/pipermail/openstack-dev/2015-June/067030.html
Change-Id: Ib4c3f77f8cc3cdaa3c7558b7bc3a6d1299b6dcbe
Partially-Implements: blueprint jscs-cleanup
This patch adds jscs as an npm dependency, and executes it within
the npm venv. It can be used to trigger the infra npm-run-lint job
and thus get voting javascript code linting into infra.
Change-Id: I2c92a7596a8faee28de582493bdf72425deac8cc
This patch adds several fixes to improve karma test handling.
* A postinstall hook was added to package.json, which tests for
the existence of .venv. If it is not found, it will invoke
tox -e py27 --notest.
* Both karma.conf files were taught to automatically detect the
directories in which the xstatic dependencies might live, and
pick the appropriate directory.
postinstall was chosen, because setting up a virtual environment
is likely to be useful for more than one type of npm job.
Change-Id: I822cb020bd8b2ca8d4f994b9734af5636e4bd144
Turns out that npm runs a little like venv's do, in that it can
install executables in its own path. This adds the karma-cli
executable into the npm path, and removes additional extraneous
content from the package.json file.
Change-Id: Ib25553956a9757ecbb1ee7ce722f3646ededc035
Establish features for running Karma tests. Separate karma configurations
are used due to current overlap of template file structure.
You can run the karma tests via:
./run_tests.sh --karma
The Karma framework allows for many features like unit test coverage and
provides a common configuration for different test runners.
Change-Id: I79680ef6369383c148da68e6677945886a48df81
Implements: blueprint karma