Commit graph

45 commits

Author SHA1 Message Date
Tom Najdek
e86bbfbda0 Tweak test runner to work in MSYS environment on Windows 2017-06-06 00:36:03 -04:00
Dan Stillman
748c30206f Run tests from build dir 2017-06-01 11:36:16 -04:00
Dan Stillman
90a3013802 Disable script run time warning in tests 2017-01-21 06:37:44 -05:00
Dan Stillman
238ab80699 Add -s flag to runtests.sh to start at given file
Useful for restarting after spurious errors when using -f

E.g., ./runtests.sh -s syncEngine
2016-12-16 04:21:37 -05:00
Dan Stillman
8799bb4ebd Remove Travis debugging 2016-11-29 03:29:45 -05:00
Dan Stillman
30d0858ebf Travis debugging 2016-11-29 01:42:15 -05:00
Dan Stillman
a735d5dd41 Remove Travis debugging 2016-11-27 20:02:53 -05:00
Dan Stillman
837ae0444d Travis debugging 2016-11-27 19:51:48 -05:00
Dan Stillman
288d0c7c06 Create 'profile' and 'Zotero' directories in temp dir for tests 2016-11-22 01:45:07 -05:00
Dan Stillman
cfe76a6f83 Add Zotero.test, which is true during tests
(Zotero.automatedTest is only true in Travis)
2016-11-13 04:54:57 -05:00
Adomas Venčkauskas
c1a3a8411f File descriptor hard limit changed to 4096 on Ubuntu 16.10 2016-10-21 12:29:29 +03:00
Adomas Ven
82fcb09716 Adds a way to distinguish linux windows (#1078)
Only enabled on Xorg environments, so checks $DISPLAY
https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#X11_options
2016-08-16 04:03:07 -04:00
Dan Stillman
daf0f8e0b0 Merge branch '4.0' 2016-08-14 17:27:36 -04:00
Dan Stillman
a5d74ceb81 Test with /Applications/Firefox Unbranded.app by default on OS X 2016-08-13 03:35:43 -04:00
Dan Stillman
2d88b07855 Set Zotero.automatedTest flag instead of .noUserInput on Travis
And don't skip alerts in Zotero.alert() during automated tests. (That
was intended to avoid long timeouts after unexpected failures, but,
e.g., PDF metadata lookups (which are currently disabled in automated
tests) should just be mocked so they don't intermittently fail.)
2016-06-24 18:28:32 -04:00
Dan Stillman
4e50b7ddc2 Increase default test timeout to 10 seconds on Travis
Maybe this will fix some of the intermittent failures...
2016-04-26 02:43:44 -04:00
Dan Stillman
300c8e8aea Leave default log level at 5 during test runs
Otherwise if debug output logging is enabled in the prefs nothing is
logged. Test output is still controlled by '-d n'.
2016-04-24 04:02:33 -04:00
Dan Stillman
4f54214f11 Disable auto-sync pref for tests
We don't want auto-sync to try to run during unrelated tests.
Additionally, even though the sync process wouldn't actually start due
to the absence of an API key (which is injected directly into the sync
functions for sync tests), since auto-sync kicks off after a one-second
delay on pane open, during tests the Zotero object has often been torn
down by the time the check code runs, producing spurious errors in the
console.
2016-04-01 02:49:50 -04:00
Dan Stillman
d826e6b0e8 Disable Firefox Health Check in tests 2016-03-23 04:29:38 -04:00
Dan Stillman
2d8f37967e Add -h flag to test runner to display help cleanly 2016-02-22 16:00:37 -05:00
Dan Stillman
3ac4203a75 Increase open files limit during tests
Mozilla file functions (OS.File.move()/copy(),
NetUtil.asyncFetch/asyncCopy()) can leave file descriptors open for a
few seconds (even with an explicit inputStream.close() in the case of
the latter), so a source installation that copies ~500 translators and
styles (with fds for source and target) can exceed the default 1024
limit.
2016-01-26 04:39:36 -05:00
Dan Stillman
ae69fbbd9b Disable Firefox extension signature checking during tests 2015-10-29 03:57:04 -04:00
Dan Stillman
2b8a5ba0b7 Disable extension signing check for test runs 2015-10-26 05:00:38 -04:00
Dan Stillman
213325636d Disable automatic backups during test runs 2015-06-11 16:06:32 -04:00
Simon Kornblith
3fc38d750b Use Zotero.Item.fromJSON() for saving from translators
Also:
  - Move some canonicalization of items returned by translators to
    Zotero.Translate
  - Make Zotero.Translate#translate return a promise
  - Add tests
2015-06-07 17:30:41 -04:00
Simon Kornblith
e10deedc7e Emit valid prefs.js even when debugging not enabled 2015-06-07 17:22:57 -04:00
Dan Stillman
b3555983d2 Fix -g test switch 2015-06-01 01:10:54 -04:00
Simon Kornblith
9bb01d737c Merge branch '4.0' into sjk/659 2015-06-01 00:03:20 -04:00
Dan Stillman
fd45032210 Add -g flag to run only tests matching a pattern (grep)
(Actually, it's only matching strings for me, not patterns, but according to
Mocha it's supposed to compile the patterns using RegExp.)
2015-05-31 03:37:45 -04:00
Dan Stillman
f3a6b41c1c Add -f test flag to stop after first test failure
(Mocha has a 'bail' config flag that's supposed to do this, but it doesn't seem
to work when passed to mocha.setup() (maybe because we're setting a custom fail
handler?), so this just calls abort() on the runner manually.)
2015-05-29 04:01:40 -04:00
Dan Stillman
8f2356f7c3 Delete test directory on exit when using -c 2015-05-27 21:42:37 -04:00
Aurimas Vinckevicius
2ebce91ecf Add -g flag to runtests.sh to generate test data
Add functions to generate sample data for various formats
* Zotero Web API JSON (Zotero.Item::toJSON)
* CiteProc-JS JSON
* Export translator JSON
* Direct serialization of Zotero.Item fields
Add a way to load sample data into DB from JSON
Add tests for loading sample data into DB
Add tests for automatically generated data
This will help us make sure that field mappings and data formats don't change
2015-05-26 16:04:55 -05:00
Dan Stillman
aa730bb3bd Merge branch '4.0'
Conflicts:
	chrome/content/zotero/fileInterface.js
	chrome/content/zotero/xpcom/translation/translate_item.js
	chrome/content/zotero/xpcom/utilities_internal.js
	chrome/content/zotero/zoteroPane.js
2015-05-23 18:26:32 -04:00
Dan Stillman
09f08d63ea Skip default browser check 2015-05-05 02:53:08 -04:00
Aurimas Vinckevicius
2566ca27e0 Don't report translator failures from tests 2015-05-02 15:30:25 -05:00
Dan Stillman
f4b6e22817 Disable browser UI tour in test profile 2015-04-26 18:08:25 -04:00
Dan Stillman
51c7ae6e5c Add -b option to skip translator/style installation in tests
'b' for *b*undled files

Translators and styles take a long time to install and initialize in
source installations, and they're unnecessary for many tests.

This shaves about 10 seconds off each test run for me on one system (and
that's with some help from filesystem caching).
2015-04-16 20:50:15 -04:00
Dan Stillman
96f3cc1861 Enable debug.time pref in tests 2015-04-15 00:48:03 -04:00
Dan Stillman
9511c43432 Create empty data directory in test profile
This prevents the data directory migration prompt from showing up if
there's an existing data directory inside the Standalone profile.
2015-04-12 20:28:50 -04:00
Aurimas Vinckevicius
f6510419cb Skip test for "recognizePDF without DOI" on Travis-CI
Breaks due to CAPTCHA when tests are run frequently
2015-04-06 23:17:41 -05:00
Aurimas Vinckevicius
ac363101fc Always use latest Firefox version and echo it for tests
Don't echo version on Windows, because it hangs Firefox
Also add testing with Firefox Beta (and prior ESR, but commented out for now, since we don't support it and we know it breaks)
2015-04-06 23:16:44 -05:00
Aurimas Vinckevicius
9624f6fac3 Fix runtests.sh to work with cygwin 2015-03-24 02:13:09 -05:00
Simon Kornblith
c2d32c2e27 Just give up on trying to automate the panel itself 2015-03-09 16:49:50 -04:00
Simon Kornblith
50cd396918 Make debugging tests a bit easier
- Add command-line argument to enable debug logging
- Add command-line argument to open (and leave open) jsconsole
- Try to print error stack traces (although Mocha doesn't seem to like
  them?)
2015-03-07 22:17:44 -05:00
Simon Kornblith
1c32db68da Unit testing infrastructure
Implements the beginnings of unit testing infrastructure using
mocha/chai. The unit tests can be run locally using test/runtests.sh,
although this will need tweaks to run on Windows. They should also run
on commit using Travis-CI.

The unit tests themselves live in test/tests. The index.js file
specifies separate test sets, which can be run individually by calling
test/runtests.sh <testsets>. Right now there is only a single unit
test, but hopefully we'll have more soon...
2015-03-07 16:34:55 -05:00