Skip to content
This repository has been archived by the owner on Aug 28, 2020. It is now read-only.

Existing Suite Test is Failing #66

Open
hydrosquall opened this issue Oct 8, 2017 · 9 comments
Open

Existing Suite Test is Failing #66

hydrosquall opened this issue Oct 8, 2017 · 9 comments

Comments

@hydrosquall
Copy link
Contributor

hydrosquall commented Oct 8, 2017

Running python setup.py test fails the test_update_package_manager_data test case.

The error message is that

'node_http_client_downloads' is an invalid keyword argument for PackageManagerData

The PackageManagerData class needs to be augmented with this keyword argument so that tests can pass again.

My Environment

  • Mac OS Sierra 10.12.6
  • Running pyenv python 3.5.3
@hydrosquall
Copy link
Contributor Author

I just took a look at currently open PRs, and it appears that #58 might fix these issues. Not 100% sure though.

@mbernier
Copy link
Contributor

@hydrosquall it looks like @osantana confirmed that this will fix the tests. Once we get that merged, can you please verify?

@hydrosquall
Copy link
Contributor Author

@mbernier sure, just tag me when that goes through :)

@thinkingserious
Copy link
Contributor

@hydrosquall,

#58 was merged :)

@hydrosquall
Copy link
Contributor Author

@thinkingserious -

I just pulled the latest changes from master, and it looks to me like the 2 tests still fail:

ERROR: test_update_package_manager_data (test.test.TestPackageManagers)
...
TypeError: 'node_http_client_downloads' is an invalid keyword argument for PackageManagerData
======================================================================
ERROR: test_update_package_manager_data (test.test.TestPackageManagers)
----------------------------------------------------------------------
TypeError: 'node_http_client_downloads' is an invalid keyword argument for PackageManagerData

@osantana
Copy link
Contributor

I just pulled the latest changes from master, and it looks to me like the 2 tests still fail:

Have you tried to recreate your DB with new db/data_schema.sql?

@hydrosquall
Copy link
Contributor Author

@osantana - nice catch, that made the keyword argument error go away.

With that said, the tests as they stand still fail because the tests that attempt to retrieve data from the DB fail unless you ran python app.py in advance, because it seems that the suite doesn't populate the DB with any dummy data. Perhaps this will be taken care of when the Database calls get mocked in a different PR.

======================================================================
ERROR: test_get_data (test.test.TestDBConnector)
----------------------------------------------------------------------
    self.assertTrue(isinstance(github_data[0], GitHubData))
IndexError: list index out of range
======================================================================
ERROR: test_get_data (test.test.TestDBConnector)
----------------------------------------------------------------------
    self.assertTrue(isinstance(github_data[0], GitHubData))
IndexError: list index out of range

@osantana
Copy link
Contributor

I tried to run locally and all tests passed successfully. But the tests made some requests to Github API using my GITHUB_TOKEN configuration.

It would be good to replace this requests with mock or something like vcrpy.

@hydrosquall
Copy link
Contributor Author

Right, the tests only pass if you run python app.py first. This shouldn't be a prerequisite to the tests passing, so I'm not sure if mocking would erase the issue of the DB not being populated without doing a full DB population first.

I was thinking of using vcrpy for #13 this weekend.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants