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

Travis test and testable example #1

Merged
merged 5 commits into from
Mar 24, 2018
Merged

Conversation

yookoala
Copy link
Contributor

  • Add travis test configuration. CI test for future commits.
  • Add badges and links.
  • Improve documentation and test coverage by converting example to testable example

* Add travis badge to show latest master build status.
* Add godoc badge to link to godoc.org page for documentations.
* Add gocover.io badge to show test coverage.
* Improve documentation in godoc and test coverage by converting
  existing examples into testable examples.
@kazarena
Copy link
Member

@yookoala many thanks for the PR, it's very useful.

My only concern is about turning examples into tests:

  • These examples aren't really tests (they don't test anything)
  • They connect to external resources
  • There is extensive test coverage for this functionality already

I would either leave them as examples or, if you feel there's a need to have simple tests as a way to learn/play with the library, add asserts and mock out any external connectivity.

@yookoala
Copy link
Contributor Author

yookoala commented Mar 22, 2018

Turning examples into testable example would:

  1. Improve the Godoc page (see the doc page of my fork). Only examples there would display on the doc page (next to the relevant function / method).
  2. With the help of CI setup, ensure that the examples works indeed on every commit. Or, let you know when they no longer work.

If I'm not mistaken, only ExampleJsonLdProcessor_Expand_online() links to external resource (thus online). We could improve it by overriding the DocumentLoader.

* Override http.DefaultTransport with a mock network if the
  environment variable `CI` is "true" (e.g. in Travis environment).
@kazarena
Copy link
Member

@yookoala in regards to the examples, this is very smart!

New commits also make a lot of sense. Will merge soon.

@kazarena kazarena merged commit e076851 into piprate:master Mar 24, 2018
@yookoala yookoala deleted the travis branch March 24, 2018 15:49
@yookoala
Copy link
Contributor Author

@kazarena: To make the travis setup really work, you'd need to:

  1. Login to Travis with your Github account.
  2. Allow Travis to read this repository / Synchronize your account with it.
  3. Enable tests for this repository.

Then newer comment / pull requests will trigger Travis CI testing and report to Github.

@kazarena
Copy link
Member

@yookoala This is done and the build is passing. Thank you!

kazarena pushed a commit that referenced this pull request Oct 4, 2022
…dataset

refactor: Move initialization of rxURL from global to function scope
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.

None yet

2 participants