Skip to content

Commit

Permalink
feat: porting over test_hgvs_variantmapper_gcp (#21) (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Mar 2, 2023
1 parent 6873324 commit 7f925c8
Show file tree
Hide file tree
Showing 33 changed files with 843 additions and 351 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ tests/data/*.gz filter=lfs diff=lfs merge=lfs -text
tests/data/*/*.gz filter=lfs diff=lfs merge=lfs -text
tests/data/*.fasta filter=lfs diff=lfs merge=lfs -text
tests/data/*/*.fasta filter=lfs diff=lfs merge=lfs -text
tests/data/*/*.tsv filter=lfs diff=lfs merge=lfs -text
tests/data/*/*/*.tsv filter=lfs diff=lfs merge=lfs -text
26 changes: 23 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ jobs:
needs: Formatting
runs-on: ubuntu-latest

strategy:
matrix:
include:
- label: fast
- label: full

services:
# The tests need a postgres server; the data will be loaded later
# after checkout.
Expand Down Expand Up @@ -90,20 +96,34 @@ jobs:

- uses: Swatinem/rust-cache@v1.3.0

- name: Run cargo-tarpaulin
- name: Run cargo-tarpaulin with fast tests
uses: actions-rs/tarpaulin@v0.1
with:
version: 0.21.0
args: "-- --test-threads 1"
args: "-- --test-threads 1 ${{ matrix.flag }}"
env:
TEST_UTA_DATABASE_URL: postgres://uta_admin:uta_admin@0.0.0.0/uta
TEST_UTA_DATABASE_SCHEMA: uta_20210129
TEST_SEQREPO_CACHE_MODE: read
TEST_SEQREPO_CACHE_PATH: tests/data/seqrepo_cache.fasta
if: ${{ matrix.label == 'fast' }}

- name: Run cargo-test with full tests
uses: actions-rs/cargo@v1
with:
command: test
args: "--release -- ${{ matrix.flag }}"
env:
TEST_UTA_DATABASE_URL: postgres://uta_admin:uta_admin@0.0.0.0/uta
TEST_UTA_DATABASE_SCHEMA: uta_20210129
TEST_SEQREPO_CACHE_MODE: read
TEST_SEQREPO_CACHE_PATH: tests/data/seqrepo_cache.fasta
if: ${{ matrix.label == 'full' }}

- name: Codecov
- name: Codecov submission of fast test results
uses: codecov/codecov-action@v3
with:
verbose: true
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
if: ${{ matrix.label == 'fast' }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
*~
.*.sw?
/.vscode

*.lock
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ nom = "7.1.3"
phf = { version = "0.11.1", features = ["macros"] }
postgres = { version = "0.19.4", features = ["with-chrono-0_4"] }
pretty_assertions = "1.3.0"
quick_cache = "0.2.2"
regex = "1.7.1"
seqrepo = { git = "https://github.com/bihealth/seqrepo-rs.git", branch = "27-whole-fasta-sequences-are-read" }
serde = { version = "1.0.152", features = ["derive"] }
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export TEST_SEQREPO_CACHE_PATH=tests/data/seqrepo_cache.fasta
```

When running the tests with `cargo test`, the cache file will be (re-)written.
Note that you have to use `cargo test --release -- --test-threads 1 --ignored` when writing the cache for enforcing a single test writing to the cache at any time.
If you don't want to regenerate the cache then you can use the following settings.
With these settings, the cache will only be read.

Expand All @@ -45,7 +46,7 @@ After either this, you can run the tests.
cargo test
```

## Creating Recuded UTA Databases
## Creating Reduced UTA Databases

The script `tests/data/data/bootstrap.sh` allows to easily build a reduced set of the UTA database given a list of genes.
The process is as follows:
Expand Down
2 changes: 1 addition & 1 deletion src/data/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ pub struct TxMappingOptionsRecord {

/// Interface for data providers.
pub trait Provider {
/// Return the data version, e.g., `uta_20180821`.
/// Return the data version, e.g., `uta_20210129`.
fn data_version(&self) -> &str;

/// Return the schema version, e.g., `"1.1"`.
Expand Down
Loading

0 comments on commit 7f925c8

Please sign in to comment.