π¨ π¨ π¨ π¨ π¨ π¨ π¨
- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Note: This document is obsolete. Please refer to Autopush Documentation on GitHub.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π¨ π¨ π¨ π¨ π¨ π¨ π¨
TestingΒΆ
Testing ConfigurationΒΆ
When testing, itβs important to reduce the number of potential conflicts as much as possible. To that end, itβs advised to have as clean a testing environment as possible before running tests.
This includes:
- Making sure notifications are not globally blocked by your browser.
- βDo Not Disturbβ or similar βdistraction freeβ mode is disabled on your OS
- You run a βfreshβ Firefox profile (start firefox βP to display the profile picker) which does not have extra extensions or optional plug-ins running. Running firefox βP βno-remote allows two different firefox profiles run at the same time.)
You may find it useful to run firefox in a Virtual Machine (like VirtualBox or VMWare), but this is not required.
In addition, it may be useful to open the Firefox Brower Console (Ctrl+Shift+J) as well as the Firefox Web Console (Ctrl+Shift+K). Both are located under the Web Developer sub-menu.
Running TestsΒΆ
If you plan on doing development and testing, you will need to install some additional packages.
$ bin/pip install -r test-requirements.txt
Once the Makefile has been run, you can run make test
to run the test suite.
Note
Failures may occur if a .boto
file exists in your home directory. This
file should be moved elsewhere before running the tests.
Disabling Integration TestsΒΆ
make test
runs the tox
program which can be difficult to break for
debugging purposes. The following bash script has been useful for running
tests outside of tox:
#! /bin/bash
mv autopush/tests/test_integration.py{,.hold}
mv autopush/tests/test_logging.py{,.hold}
bin/nosetests -sv autopush
mv autopush/tests/test_integration.py{.hold,}
mv autopush/tests/test_logging.py{.hold,}
This script will cause the integration and logging tests to not run.
Firefox TestingΒΆ
To test a locally running Autopush with Firefox, you will need to edit several config variables in Firefox.
- Open a New Tab.
- Go to
about:config
in the Location bar and hit Enter, accept the disclaimer if itβs shown. - Search for
dom.push.serverURL
, make a note of the existing value (you can right-click the preference and chooseReset
to restore the default). - Double click the entry and change it to
ws://localhost:8080/
. - Right click in the page and choose
New -> Boolean
, name itdom.push.testing.allowInsecureServerURL
and set it totrue
.
You should then restart Firefox to begin using your local Autopush.
DebuggingΒΆ
On Android, you can set dom.push.debug
to enable debug logging of Push
via adb logcat
.
For desktop use, you can set dom.push.loglevel
to "debug"
. This will
log all push messages to the Browser Console (Tools > Web Developer > Browser
Console).