-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests failed in master branch #148
Comments
At which point of the code (i.e. githash commit) are you running the tests? |
Master branch commit → 9145fda |
That point in code seems to be a bit old (August 2nd). Could you checkout the last version of master and test again, please? As a refrence, this is the result of the test in my local environment with the last version of master today (18d6ebc5933f8c098e58ca0a499c24aa2951eb5c):
|
How are you running the tests? Because following the Testing section in README.md I'm running even different number of tests. |
Maybe I did a dirty and invalid test. Let's try again with the latest in master. Full script (skipping some longs parts):
(Sometime one of the test fails due to timeout, but I haven't pay too much importance to it, as I understand is a problem of my local enviornament as far as it works in travis. If I expand the timeout changing the following lines in packages.json it seems to work fine)
|
Do you have mongo installed and running in the host where you run the tests? In my case, I do, and, as far as I understand by .travis.yml, it's needed. |
Ok, I ran MongoDB with docker and now all tests work. This requirement may be described in the testing documentation section. On the other hand, all tests are under the common unit/ directory while most tests seem to be more integration, system or e2e tests. |
Documentation modified in PR #156. Please have a look and provide LGTM if you find it ok (or suggest and alternative wording).
Not sure of fully understand you... could you provide some more detail please? |
IMHO, the fact that you need mongo for some tests shows that not all of your tests are unit. At least those check the integration with mongo, in a direct or indirect way. In addition, other tests check the functionality by starting a client and a server and making assertions on any of the parts. I don't think this kind of tests can be classified as unit. |
From a strict point of view, you are right. However, doing "pure" unit tests without mongo would need a mock for mongo, which make the test implementation more complex. Thus, using mongo in this case seems to be a good trade off between complexity and "unitiness".
Which ones? Could provide a link to some, please? Anyway, probably is a case like the former: they aren't pure unit test but anyway provide valuable testability of some parts of the code (in fact, an integration test is usually more valuable than an unit test, as it is testing a case closer to real utilizanton of the software). |
Problem:
Two tests fail executing
npm test
The second test is included in the unit testing directory while it seems is testing a transaction with a mongo database.
I am interested in contributing some smalls modifications in order to make the server compatible with other OMA LwM2M libraries. In this way, in order to follow the contribution guidelines, I need to be able to run the tests without fail.
Thank you in advance
The text was updated successfully, but these errors were encountered: