Comments (5)
Of course, if the services actual tests are based on fail we will still have failures in the package. We could look into mocking responses to test post request processes.
from emodnetwfs.
Hi @annakrystalli,
Here some ideas but I'm very open to discussion 😊
Test service in a different GitHub Action
I agree but ideally once #24 is solved (e.g. read the available endpoints from the Central Portal CSW or similar) we wouldn't need to test the services at all. Do you mean that we should test the services in a different GitHub Action as a temporal fix or also for the long term?
Mocking responses for testing sounds like a good idea for me. This way we what the package is supposed to do without relying on the services. But these could be part of the regular testing of the package and no need for a different GitHub action I think.
Report package result on README
I'm not completely sure what do you mean by this. Something that we have been struggling is that the build can fail because there are examples in the README and the vignette that rely on an specific service. (e.g. the build yesterday). How would you show examples without risking that they make the build fail?
Some random ideas:
- Show examples but do not actually run (
eval = FALSE
) - Somehow make the examples depend on the services available at the Central Portal CWS
- The examples use mock responses.
I kinda like more option 2 the most so far.
from emodnetwfs.
Test service in different GA
Actually you are right. Once we sort out #24, this will be unnecessary so it's probably not worth the effort.
Report package results in README
sorry I wasn't very clear! I meant the R CMD CHECK status badge on the README should not reflect the status of the servers in any way but rather the code. Indeed the examples in vignettes and the README you mention that are server status dependant but can cause our checks to fail are also a similar problem.
Solution
In all honesty I haven't made best use of tools available or best practice of testing API wrappers (sorry still learning!) and agree that mocking is that right way forward. Indeed looking at package httptest
https://enpiar.com/r/httptest/, I think it has all the functionality we need! And as we can capture responses when the server is working and cache it, we can try and use such cached objects for our vignettes and README too! 😃
So moving forward I think we should:
- Overhaul testing of our functions using mocking and
httptest
(this issue). - Move testing of services to runtime rather than as part of testing suite (as per #24).
I'm happy to handle this issue. So do you want to look into #24 @salvafern or do you want me to handle both?
Also, happy to schedule a quick call to get on the same page and brainstorm some ideas if you want.
from emodnetwfs.
Had a chat with @annakrystalli today:
- @annakrystalli: Ask to the rOpenSci community what do they do in these cases in other packages
- @annakrystalli: Use
httptest
to catch data in the README and vignettes. - @annakrystalli: Add a job to check and update the cached data if possible. This will run approx. every month and it will be separated from the R-CMD-Check.
@salvafern will work on #24
from emodnetwfs.
What remains to be done here? httptest is now used.
from emodnetwfs.
Related Issues (20)
- new test failure
- pkgdown failure due to vignette HOT 4
- Get list of all OGC endpoints from catalog instead of hard-coded text file HOT 8
- Link to WFS endpoints in emodnetwfs.Rmd is broken HOT 2
- `emodnet_get_wfs_info(wfs_bio)` introduced twice HOT 1
- Question: Dump all data in one go? HOT 5
- add section about related packages to README HOT 1
- increase test coverage HOT 2
- investigate R CMD check error that pkgcheck is mentioning HOT 3
- All layers are of class data.frame? HOT 3
- explore wfs biology_new_data_products HOT 7
- why would one use rerddap HOT 2
- Could guess_layer_format() use ows4r's `$getGeometryType()`?
- Problem with a layer of the physics server HOT 6
- update example in request-params.Rmd HOT 7
- change lifecycle badge status once build green again
- could we rename the package to all lowercase? HOT 32
- Bug with a layer of biology_occurrence_data HOT 12
- Bug with a layer of chemistry_marine_litter HOT 7
- How to get the package listed from the FAQ
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emodnetwfs.