Skip to content
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

Dev/unit tests #246

Merged
merged 24 commits into from
Apr 14, 2019
Merged

Dev/unit tests #246

merged 24 commits into from
Apr 14, 2019

Conversation

lorenzoPrimi
Copy link
Contributor

Fixes #233

Proposed Changes

  • Basic unit tests

.travis.yml Outdated Show resolved Hide resolved
Copy link
Member

@hellais hellais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a great start for the tests. One thing I would look into doing is seeing if instead of construction the database models yourself by setting attributes you load a sqlite database as a fixture to the test with real values in it.

This will allow you to write model validation tests that use real data.

Another interesting thing to do would be to try and have the nettest workflow write the database and then you would call the relevant functions to ensure that it wrote the expected values in the DB.

OONIProbeUnitTests/NetworkTest.m Outdated Show resolved Hide resolved
OONIProbeUnitTests/NetworkTest.m Show resolved Hide resolved
OONIProbeUnitTests/TestKeysTest.m Show resolved Hide resolved
ooniprobe/Model/JsonResult/TestKeys.h Show resolved Hide resolved
@lorenzoPrimi
Copy link
Contributor Author

@hellais can this be merged like android?

Copy link
Member

@hellais hellais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I would say that as soon as the failure on travis is investigated and resolved this can be merged into master.

See: https://travis-ci.org/ooni/probe-ios/builds/511524503#L1717 & https://github.com/ooni/probe-ios/pull/246/files#r273503527

@lorenzoPrimi
Copy link
Contributor Author

Now travis works, UI tests are kinda broken. I filled a ticket and will work on them in another branch.
https://github.com/ooni/probe-ios/issues/262

@lorenzoPrimi
Copy link
Contributor Author

Travis still with some error as the last row added by me executes all tests, including UI Tests, not only unit tests

@lorenzoPrimi
Copy link
Contributor Author

travis fixed and building. unit test working.
Merging into master.

@lorenzoPrimi lorenzoPrimi reopened this Apr 14, 2019
@lorenzoPrimi lorenzoPrimi merged commit f3e832b into master Apr 14, 2019
@lorenzoPrimi lorenzoPrimi deleted the dev/unit_tests branch April 14, 2019 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better testing for iOS app
3 participants