Open abathur opened 6 years ago
Cloning your package and running UnitTesting reveals that there is an error in the source code
test_core (unittest.loader.ModuleImportFailure) ... ERROR
======================================================================
ERROR: test_core (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
Traceback (most recent call last):
File "./python3.3/unittest/case.py", line 384, in _executeTestPart
File "./python3.3/unittest/loader.py", line 32, in testFailure
ImportError: Failed to import test module: test_core
Traceback (most recent call last):
File "./python3.3/unittest/loader.py", line 261, in _find_tests
File "./python3.3/unittest/loader.py", line 239, in _get_module_from_name
File "/Users/Randy/Dropbox/Sublime Text 3/Packages/Constellation/tests/test_core.py", line 13
s = sublime.load_settings("Preferences.sublime-settings")
^
TabError: inconsistent use of tabs and spaces in indentation
----------------------------------------------------------------------
Ran 1 test in 0.009s
FAILED (errors=1)
UnitTesting: Done.
With run_tests --coverage
, UnitTesting would first reload the package first. The error may explain why UnitTesting is not responding.
Also, you are using DeferrableTestCase
but deferred
is not set to true.
@randy3k Not running master, or my output would show the same.
I'd already wiped the debug branch I was working on, but I've re-produced the issue for you:
Broken/coverage: https://travis-ci.org/abathur/constellation/jobs/364712602 Working/no-coverage: https://travis-ci.org/abathur/constellation/jobs/364710289
@randy3k I saw that you were able to reproduce this CI failure on a fork yesterday. I also noticed that you've bumped versions, so ran the failing build again to see. It still breaks, but the output is a little different, so I thought I'd update you in case it saves a any work:
[0K$ sh travis.sh bootstrap
Running command: bootstrap
copy the package to sublime package directory
download UnitTesting tag: 1.3.1
bccbc6e304dcb616d40f4d185fafe8ed16c055b6
download sublime-coverage tag: 1.0.0
bdda8348acf163fbb2c7e276d7d5415c2d0fa4bb
installing sublime text 3
downloading https://download.sublimetext.com/sublime_text_3_build_3143_x64.tar.bz2
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 9626k 100 9626k 0 0 51.9M 0 --:--:-- --:--:-- --:--:-- 52.2M
...
[0K$ sh travis.sh run_tests --coverage
Running command: run_tests --coverage
Schedule:
output: /home/travis/.config/sublime-text-3/Packages/User/UnitTesting/Constellation/result
syntax_test: None
color_scheme_test: None
coverage: True
package: Constellation
Xlib: extension "RANDR" missing on display ":99.0".
Wait for tests output..................................
Timeout: Could not obtain tests output.
Maybe Sublime Text is not responding or the tests outputis being written to the wrong file.
travis_time:end:154e5900:start=1523550327857172650,finish=1523550358772913578,duration=30915740928
[0K
[31;1mThe command "sh travis.sh run_tests --coverage" exited with 1.[0m
Done. Your build exited with 1.
@randy3k I figured this out today. I'm tempted to close because this is mostly my fault, but I'll see what you think since it was a little tricky.
yield
statements out of actual test methods would mean they don't actually delay execution, and that they would guard any subsequent assertions from being run.I'm not quite certain from here why the "timeout" messages on travis-ci. I suspect the above errors are just eating critical output and leaving it puzzled.
I'm fine with closing this unless you have some ideas about how one platform or the other could detect and message more clearly in this case.
how about using yield form
https://docs.python.org/3/whatsnew/3.3.html#pep-380?
I've got my tests working already; I needed to split methods up along similar lines for entirely different reasons, which is how I noticed what was going on.
But yes, the test method could have properly handled yield in a sub-call if I had been paying enough attention. :)
Though, I did get this other response (https://github.com/emanuelen5/Word-highlighter/commit/1fe8c0eccc22a78569a7d509e4d3f1ae0a71b2aa#commitcomment-30289483) from @emanuelen5; it sounds like his case was a simple syntax error. Maybe there's just a broader problem with the coverage script swallowing other messages (perhaps if they don't fit some format?)
A syntax error like that is always fatal. This is the reason for the timeout.
Wait, I may have misunderstood the issue, the error was from the test suite....there may be something fishy there.
I'm not sure if I've stumbled into a real issue, or just fallen into a documentation hole.
I had a bear of a time getting travis-ci set up this time. When I use
run_tests --coverage
, I get a timeout waiting for ST3 to respond. When I userun_tests
without coverage, they run fine. The raw logs for both runs show the bootstrap installing sublime-coverage:Here's an example of the time-out/coverage run:
Here's an example of one succeeding without: