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

Expand use of vcr in testing #411

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/check-api-stability.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Workflow derived from
# https://github.com/r-lib/actions/blob/v2-branch/examples/check-standard.yaml

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
schedule:
- cron: "0 12 * * 0"

name: Run tests without {vcr}

jobs:
test:
runs-on: ubuntu-latest

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
VCR_TURN_OFF: true

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
#TODO: don't need to run full check() here. Probably only test() is fine
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
542 changes: 542 additions & 0 deletions tests/fixtures/chebi-article.yml

Large diffs are not rendered by default.

720 changes: 720 additions & 0 deletions tests/fixtures/chebi-correct.yml

Large diffs are not rendered by default.

86 changes: 86 additions & 0 deletions tests/fixtures/chebi-smiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
http_interactions:
- request:
method: post
uri: http://www.ebi.ac.uk/webservices/chebi/2.0/webservice
body:
encoding: ''
string: |-
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:chebi="https://www.ebi.ac.uk/webservices/chebi">
<soapenv:Header/>
<soapenv:Body>
<chebi:getLiteEntity>
<chebi:search>triclosan</chebi:search>
<chebi:searchCategory>ALL</chebi:searchCategory>
<chebi:maximumResults>200</chebi:maximumResults>
<chebi:stars>ALL</chebi:stars>
</chebi:getLiteEntity>
</soapenv:Body>
</soapenv:Envelope>
headers:
Accept: multipart/*
Content-Type: text/xml; charset=utf-8
SOAPAction: ''
response:
status:
status_code: 200
category: Success
reason: OK
message: 'Success: (200) OK'
headers:
server: Apache-Coyote/1.1
content-type: text/xml;charset=utf-8
transfer-encoding: chunked
date: Thu, 03 Aug 2023 19:34:28 GMT
body:
encoding: ''
file: no
string: <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><getLiteEntityResponse
xmlns="https://www.ebi.ac.uk/webservices/chebi"><return><ListElement><chebiId>CHEBI:164200</chebiId><chebiAsciiName>triclosan</chebiAsciiName><searchScore>0.88</searchScore><entityStar>3</entityStar></ListElement><ListElement><chebiId>CHEBI:89302</chebiId><chebiAsciiName>Triclosan
glucuronide</chebiAsciiName><searchScore>0.26</searchScore><entityStar>2</entityStar></ListElement><ListElement><chebiId>CHEBI:89301</chebiId><chebiAsciiName>Triclosan
sulfate</chebiAsciiName><searchScore>0.13</searchScore><entityStar>2</entityStar></ListElement></return></getLiteEntityResponse></S:Body></S:Envelope>
recorded_at: 2023-08-03 19:34:29 GMT
recorded_with: vcr/1.2.0, webmockr/0.9.0
- request:
method: post
uri: http://www.ebi.ac.uk/webservices/chebi/2.0/webservice
body:
encoding: ''
string: |2-
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:chebi="https://www.ebi.ac.uk/webservices/chebi">
<soapenv:Header/>
<soapenv:Body>
<chebi:getLiteEntity>
<chebi:search>C#C</chebi:search>
<chebi:searchCategory>SMILES</chebi:searchCategory>
<chebi:maximumResults>200</chebi:maximumResults>
<chebi:stars>ALL</chebi:stars>
</chebi:getLiteEntity>
</soapenv:Body>
</soapenv:Envelope>
headers:
Accept: multipart/*
Content-Type: text/xml; charset=utf-8
SOAPAction: ''
response:
status:
status_code: 200
category: Success
reason: OK
message: 'Success: (200) OK'
headers:
server: Apache-Coyote/1.1
content-type: text/xml;charset=utf-8
transfer-encoding: chunked
date: Thu, 03 Aug 2023 19:34:28 GMT
body:
encoding: ''
file: no
string: <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><getLiteEntityResponse
xmlns="https://www.ebi.ac.uk/webservices/chebi"><return><ListElement><chebiId>CHEBI:27518</chebiId><chebiAsciiName>acetylene</chebiAsciiName><searchScore>5.01</searchScore><entityStar>3</entityStar></ListElement></return></getLiteEntityResponse></S:Body></S:Envelope>
recorded_at: 2023-08-03 19:34:29 GMT
recorded_with: vcr/1.2.0, webmockr/0.9.0
Loading