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

Failing tests issues #89

Closed
annakrystalli opened this issue Apr 4, 2022 · 3 comments
Closed

Failing tests issues #89

annakrystalli opened this issue Apr 4, 2022 · 3 comments

Comments

@annakrystalli
Copy link
Collaborator

annakrystalli commented Apr 4, 2022

The tests seem to be failing locally and in #88. I've re-run and created new snapshots in the last commit but am still getting 3 failing tests I could do with some help on.

Firstly, what I did:

Deleted the fixtures in tests/testthat/fixtures/ and then ran devtools::tests(). However this resulted in (and would only be triggered when this folder was empty) the new snapshots are still generated in folder tests/testthat/tests/testthat/fixtures rather than tests/testthat/fixtures/. I imagine that is not the wanted behaviour. How di you manage to get the

The result is that I seem to have ended up in a loop where, when I accept some changes to snapshots after devtools::test() they are accepted in the tests/testthat/tests/testthat/fixtures but then when I re-run the tests it doesn't seem to recognise that fixtures exists and tries to re-snapshot them! So I am wondering whether is is checking tests/testthat/fixtures/, finding it empty triggering snapshotting but then snapshotting is saved in tests/testthat/tests/testthat/fixtures?

@annakrystalli
Copy link
Collaborator Author

devtools::test("~/Documents/workflows/EMODnet/EMODnetWFS")
#> ℹ Loading EMODnetWFS
#> Loading ISO 19139 XML schemas...
#> Loading ISO 19115 codelists...
#> Loading IANA mime types...
#> No encoding supplied: defaulting to UTF-8.
#> ℹ Testing EMODnetWFS
#> ✓ | F W S  OK | Context
#> 
#> ⠏ |         0 | client                                                          
#> ⠋ |         1 | client                                                          
#> ⠹ |         3 | client                                                          
#> ⠴ |         6 | client                                                          
#> ⠧ | 1       7 | client
#> CrulAdapter disabled!
#> HttrAdapter disabled!
#> 
#> x | 1      10 | client [1.6s]
#> ────────────────────────────────────────────────────────────────────────────────
#> Failure (test-client.R:37:5): Services down handled
#> Snapshot of `check_service(req_fail)` has changed:
#> old vs new
#> - "An exception has occurred. Please raise an issue in https://github.com/EMODnet/EMODnetWFS/issues"
#> + "Service creation failed"
#> 
#> * Run `snapshot_accept('client')` to accept the change
#> * Run `snapshot_review('client')` to interactively review the change
#> ────────────────────────────────────────────────────────────────────────────────
#> 
#> ⠏ |         0 | filter                                                          
#> ⠋ |         1 | filter                                                          
#> ⠙ |         2 | filter                                                          
#> ⠹ |         3 | filter                                                          
#> ⠸ |         4 | filter                                                          
#> ⠼ |         5 | filter                                                          
#> ⠴ |         6 | filter                                                          
#> ⠧ |         8 | filter                                                          
#> ✓ |         9 | filter [4.3s]
#> 
#> ⠏ |         0 | info                                                            
#> ⠋ |         1 | info                                                            
#> ⠸ |         4 | info                                                            
#> ⠦ |         7 | info                                                            
#> ⠋ |        11 | info                                                            
#> ✓ |        13 | info [7.1s]
#> 
#> ⠏ |         0 | layer_attributes                                                
#> ⠋ |         1 | layer_attributes                                                
#> ⠹ |         3 | layer_attributes                                                
#> ⠸ |         4 | layer_attributes                                                
#> ⠏ |        10 | layer_attributes                                                
#> ⠹ |        13 | layer_attributes                                                
#> ✓ |        14 | layer_attributes [3.0s]
#> 
#> ⠏ |         0 | layers                                                          
#> ⠋ |         1 | layers                                                          
#> ⠇ |         9 | layers                                                          
#> ⠋ |        11 | layers                                                          
#> ⠇ |        19 | layers                                                          
#> ⠋ |        21 | layers                                                          
#> ⠙ |        22 | layers                                                          
#> ⠼ |        25 | layers                                                          
#> ⠴ |        26 | layers                                                          
#> ✓ |        27 | layers [13.7s]
#> 
#> ⠏ |         0 | vendor-params                                                   
#> ⠋ |         1 | vendor-params                                                   
#> ✓ |         1 | vendor-params [0.8s]
#> 
#> ══ Results ═════════════════════════════════════════════════════════════════════
#> Duration: 30.5 s
#> 
#> [ FAIL 1 | WARN 0 | SKIP 0 | PASS 74 ]

Created on 2022-04-04 by the reprex package (v2.0.1)

@annakrystalli
Copy link
Collaborator Author

So bizarre! Running devtools::test() at the command line gives a different result and creates a different fixture than when run in reprex() (as above comment!)

> devtools::test()
ℹ Loading EMODnetWFS
ℹ Testing EMODnetWFS
✓ | F W S  OK | Context
⠴ | 1       5 | client                                                                         CrulAdapter disabled!
HttrAdapter disabled!
x | 2       9 | client [0.5s]
───────────────────────────────────────────────────────────────────────────────────────────────
Failure (test-client.R:33:5): Services down handled
httr::http_error(req_fail) is not TRUE

`actual`:   FALSE
`expected`: TRUE 

Failure (test-client.R:37:5): Services down handled
Snapshot of `check_service(req_fail)` has changed:
old vs new
- "Service creation failed"
+ "An exception has occurred. Please raise an issue in https://github.com/EMODnet/EMODnetWFS/issues"

* Run `snapshot_accept('client')` to accept the change
* Run `snapshot_review('client')` to interactively review the change
───────────────────────────────────────────────────────────────────────────────────────────────
✓ |         9 | filter [4.1s]                                                                  
✓ |        13 | info [7.5s]                                                                    
✓ |        14 | layer_attributes [2.7s]                                                        
✓ |        27 | layers [13.0s]                                                                 
✓ |         1 | vendor-params [1.2s]                                                           

══ Results ════════════════════════════════════════════════════════════════════════════════════
Duration: 29.0 s

[ FAIL 2 | WARN 0 | SKIP 0 | PASS 73 ]
> snapshot_accept('client')
Updating snapshots:
• client.md

Snapshot file at tests/testthat/tests/testthat/fixtures/_snaps/cleint.md

# Error when wrong service

    Assertion on 'service' failed: Must be element of set {'bathymetry','biology','biology_occurrence_data','chemistry_cdi_data_discovery_and_access_service','chemistry_cdi_distribution_observations_per_category_and_region','chemistry_contaminants','chemistry_marine_litter','geology_coastal_behavior','geology_events_and_probabilities','geology_marine_minerals','geology_sea_floor_bedrock','geology_seabed_substrate_maps','geology_submerged_landscapes','human_activities','physics','seabed_habitats_general_datasets_and_products','seabed_habitats_individual_habitat_map_and_model_datasets'}, but is 'blop'.

# Services down handled

    Service creation failed

---

    An exception has occurred. Please raise an issue in https://github.com/EMODnet/EMODnetWFS/issues

# No internet challenge

    WFS client creation failed.

@maelle
Copy link
Collaborator

maelle commented Apr 26, 2022

Closed in favor of #93

@maelle maelle closed this as completed Apr 26, 2022
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

No branches or pull requests

2 participants