ExcaliburZero / jekyll-helper

A program that serves as a basic GUI for Jekyll.
MIT License
4 stars 0 forks source link

Coverage.py warning: Module jekyll_helper was never imported #20

Closed ExcaliburZero closed 9 years ago

ExcaliburZero commented 9 years ago

Currently the following warning is showing up on Travis CI, and due to this problem, Coveralls is unable to get data on the coverage of the program.

Coverage.py warning: Module jekyll_helper was never imported.
Coverage.py warning: No data was collected.
Name    Stmts   Miss  Cover   Missing
-------------------------------------
----------------------------------------------------------------------
Ran 0 tests in 0.001s
ExcaliburZero commented 9 years ago

The issue seems to have been caused by the following commands in the install section of the Travis CI config:

$ cd data
$ cd glib-2.0
$ glib-compile-schemas schemas
ExcaliburZero commented 9 years ago

I think the issue may be being caused by the cd commands in the install section changing the working directory with switching back to the main directory.

ExcaliburZero commented 9 years ago

I setup the Travis CI config file to cd back into the correct working directory, but that seems to have revealed another issue.

(nosetests:7074): GLib-GIO-ERROR **: Settings schema 'net.launchpad.jekyll-helper' is not installed

/home/travis/build.sh: line 41:  7074 Trace/breakpoint trap   nosetests --with-coverage --cover-package=jekyll_helper
ExcaliburZero commented 9 years ago

This page may be relevant:

ExcaliburZero commented 9 years ago

I tried adding an apt-get statement to install gsettings-desktop-schemas, however that did not seem to fix the issue.

ExcaliburZero commented 9 years ago

This page may be helpful:

ExcaliburZero commented 9 years ago

I changed the calling of the settings to the following:

schema_source = Gio.SettingsSchemaSource.new_from_directory(
    os.path.expanduser("/data/glib-2.0/schemas/"),
    Gio.SettingsSchemaSource.get_default(),
    False,
)
schema = schema_source.lookup('net.launchpad.jekyll-helper', False)
global settings
settings = Gio.Settings.new_full(schema, None, None)

This seems to be almost working, however it throws the following errors:

EENo config file found, using default configuration

************* Module jekyll_helper

E: 49,4:main: Instance of 'JekyllHelperWindow' has no 'show' member

************* Module jekyll_helper.JekyllHelperWindow

E: 97,41:JekyllHelperWindow.jekyll_serve_on: Undefined variable 'settings'

E: 98,17:JekyllHelperWindow.jekyll_serve_on: Undefined variable 'settings'

E:138,41:JekyllHelperWindow.on_buildButton_clicked: Undefined variable 'settings'

E:139,17:JekyllHelperWindow.on_buildButton_clicked: Undefined variable 'settings'

.

======================================================================

ERROR: Failure: GError (Failed to open file '/data/glib-2.0/schemas/gschemas.compiled': open() failed: No such file or directory)

----------------------------------------------------------------------

Traceback (most recent call last):

  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/nose/loader.py", line 414, in loadTestsFromName

    addr.filename, addr.module)

  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath

    return self.importFromDir(dir_path, fqname)

  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir

    mod = load_module(part_fqname, fh, filename, desc)

  File "/home/travis/build/ExcaliburZero/jekyll-helper/jekyll_helper/__init__.py", line 29, in <module>

    from jekyll_helper import JekyllHelperWindow

  File "/home/travis/build/ExcaliburZero/jekyll-helper/jekyll_helper/JekyllHelperWindow.py", line 43, in <module>

    class JekyllHelperWindow(Window):

  File "/home/travis/build/ExcaliburZero/jekyll-helper/jekyll_helper/JekyllHelperWindow.py", line 66, in JekyllHelperWindow

    False,

  File "/usr/lib/python2.7/dist-packages/gi/types.py", line 72, in constructor

    return info.invoke(cls, *args, **kwargs)

GError: Failed to open file '/data/glib-2.0/schemas/gschemas.compiled': open() failed: No such file or directory

======================================================================

ERROR: Failure: GError (Failed to open file '/data/glib-2.0/schemas/gschemas.compiled': open() failed: No such file or directory)

----------------------------------------------------------------------

Traceback (most recent call last):

  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/nose/loader.py", line 414, in loadTestsFromName

    addr.filename, addr.module)

  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath

    return self.importFromDir(dir_path, fqname)

  File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir

    mod = load_module(part_fqname, fh, filename, desc)

  File "/home/travis/build/ExcaliburZero/jekyll-helper/tests/test_example.py", line 29, in <module>

    from jekyll_helper import AboutJekyllHelperDialog

  File "/home/travis/build/ExcaliburZero/jekyll-helper/jekyll_helper/__init__.py", line 29, in <module>

    from jekyll_helper import JekyllHelperWindow

  File "/home/travis/build/ExcaliburZero/jekyll-helper/jekyll_helper/JekyllHelperWindow.py", line 43, in <module>

    class JekyllHelperWindow(Window):

  File "/home/travis/build/ExcaliburZero/jekyll-helper/jekyll_helper/JekyllHelperWindow.py", line 66, in JekyllHelperWindow

    False,

  File "/usr/lib/python2.7/dist-packages/gi/types.py", line 72, in constructor

    return info.invoke(cls, *args, **kwargs)

GError: Failed to open file '/data/glib-2.0/schemas/gschemas.compiled': open() failed: No such file or directory
ExcaliburZero commented 9 years ago

This page may be helpful: