-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google Summer of Code 2016 JavaScript Testing project #11420
Conversation
…gin to load fixtures
@@ -1,18 +1,19 @@ | |||
# Forces new Travis-CI Infrastructure | |||
sudo: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed as it's going to affect all jobs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, why it's in there .. I think from the beginning of GSoC project, where it still was that way in core.. Going to remove it.
@mbabker For the unit tests sudo seems not to be needed, any reasons it was reenabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We turned it off to use the newer (faster) Travis-CI structure by default. So my only guess is someone changed this testing something along the way.
The Travis log for the JavaScript tests in this PR is available here . |
Good work @Ruchiranga Looks really nice. Thanks to the GSOC Team! |
Thank you @zero-24 :) |
Good work @Ruchiranga |
@Ruchiranga That looks very cool. The video and your screenshots show when everything goes right. Can you post some shots of what happens when I break something with a code change? |
@roland-d Here is a screenshot of the And all the tests covering that function are passing. Now here, I comment line As a result, the test case covering that line would fail. It will be shown in the log as follows. The overall summary of the tests would also show that one test case is failing. |
Thank you @gunjanpatel :) |
@Ruchiranga Thank you for that explanation looks good. Good job. |
I have tested this item ✅ successfully on fda4cdb This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11420. |
Tested with travis and in a local environment. I will merge on Review This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11420. |
Good job @Ruchiranga! One thing we might can add is that it is not needed that phpunit runs for the javascript tests so if we can exclude this we can have the result faster. No big deal at all. |
@rdeutz Thank you! Yes I agree. We will make that change. Thank you very much again for taking your time to go through this and get it merged :) |
* Initial test environment setup with Jasmine, Karma and RequireJS * Seperated test setup code from test logic * Configured .travis.yml to run Karma * Fixed typo in .travis.yml * changes to .travis.yml * Added karma requirejs module * Removed unnecessary code in travis.yml * Fixed missing code is travis.yml * Removed 2 unused image files * Improved code standards * Modified travis.yml * Issue 1 Cleaned the mess with changes bunch of to unrelated files * Issue 1 Added newline at end of file * Issue 4 Improved JCaption JavaScript tests * New coeverage reporter plugin test with Travis * Issue 1 Added karma-coerage reporter and configured it to display coverage on console * Issue 1 Added and configured karma-verbose-reporter plugin * Issue 1 Fixing verbose reporter config for travis * Issue 1 removed redundant javascript dir and added requirejs/text plugin to load fixtures * Issue 4 Improved code with suggestions made in the code review * Issue 1 Added version for requirejs text plugin * Issue 1 converted space indentations to tabs * Issue 1 Fixed indentation in package.json * Issue 1 Fixed version issue in require text * Issue 1 Fixed version issue in require text * Issue 1 Fixed version issue in require text * Issue 4 Improved code standards and jquer selector efficiency * Issue 1 Tersting version issue with text plugin on travis * Issue 1 Tersting version issue with text plugin on travis * Issue 1 Tersting version issue with text plugin on travis * Issue 1 Removed spec folder * Corejs tests (joomla#15) Tests for core.js * Tests for permissions.js (#13) * Test suite for permissions.js * Added karma-jasmine-ajax plugin * Added a container div for fixtures representing library name (#11) * Added a container div for fixtures representing the library name * CS - Removed an extra new line * Permissions.js tests Test for permissions * Repeatable.js test suite * Improvements to JCaption tests * README.md update * Modified readme file * Made running tests easier by adding configuration for tests to run on npm test * Core js Improvements * Issue 9 Added jasmine spies and improved code * Issue 9 Fixed an indentation issue * Demo video on Youtube * Inserted the video demonstration link to the readme * Issue 5 Added spies and made code improvements (joomla#31) * Issue 12 Improved code (joomla#34) * Repeatable.js Improvements (joomla#35) * Run Travis JavaScript tests on separated Matrix Build (joomla#39) * Only run Travis tests on PHP 7 * Fix base path issue * Added own matrix tests for JavaScript * Added own matrix tests for JavaScript * Added own matrix tests for JavaScript * Added own matrix tests for JavaScript * Added own matrix tests for JavaScript * Added own matrix tests for JavaScript * Added own matrix tests for JavaScript * Added own matrix tests for JavaScript * Reverted README.md * Synced README.md to the new version * Synced README.md with new version * Fixed indentations * Synced README.md with 3.6 version * Fixed indentations * Fixed indentations * Added newline at the end of travis-tests.sh * Added missing sudo:false in .travis.yml
Summary of Changes
The set of custom JavaScript libraries in Joomla does not have any tests. This PR contains a test suite that will be run, like the PHP unit tests, automatically for every pull request and commit with Travis.
Shown below are some screenshots of the Travis log with the JavaScript test results.
The Travis log will also show an overview of the test coverage achieved.
As testing framework we use Jasmine, which is run by Karma-Test Runner in a real Firefox browser.
Core JavaScript Libraries covered by this Pull Request:
Documentation
The documentation is currently available here. This will be moved into the Joomla! documentation soon.
Testing Instructions
None, since this is only run on Travis. If you want to run it locally, please take a look at the documentation.
Demonstration
Demonstration video can be watched via this link.