Skip to content

Commit

Permalink
Merge pull request #122 from dfe-analytical-services/remove-3year-tim…
Browse files Browse the repository at this point in the history
…eseries-check

remove 3 year timeseries test
  • Loading branch information
cjrace authored Jul 10, 2024
2 parents 268a384 + 421ecda commit 4f5525a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 41 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/automatedTests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,20 @@ jobs:

- name: Install git2r dependencies
run: sudo apt-get install -y libgit2-dev

- name: Cache renv packages
id: cache-renv
uses: actions/cache@v4
with:
path: screener-renv-cache
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
restore-keys: |
${{ runner.os }}-renv-
- uses: r-lib/actions/setup-renv@v2

- name: Run tests
shell: Rscript {0}
run: |
shinytest2::test_app()
20 changes: 0 additions & 20 deletions R/mainTests.r
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ mainTests <- function(data_character, meta_character, datafile, metafile) {
blanks_indicators(data_character, meta_character), # active test
time_period(datafile), # active test
time_period_six(datafile), # active test
three_years(datafile), # active test
region_for_la(datafile), # active test
region_for_lad(datafile), # active test
geography_level_completed(datafile), # active test
Expand Down Expand Up @@ -707,25 +706,6 @@ time_period_six <- function(data) {
return(output)
}

# three_years -------------------------------------
# produce a warning if there are fewer than 3 years of data in the file

three_years <- function(data) {
if (length(unique(data$time_period)) < 3) {
output <- list(
"message" = "The data file contains fewer than three different years of data. <br> - Where it exists, you should include at least 3 years of data in your file to meet upcoming changes in accessibility legislation.",
"result" = "ADVISORY"
)
} else {
output <- list(
"message" = "The data file contains at least three different years of data.",
"result" = "PASS"
)
}

return(output)
}

# region_for_la -------------------------------------
# check if there is LA level data, and if so, if regional columns are present and completed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
}
},
"export": {
"advisory": 1,
"advisory": 0,
"ancillary": 1,
"failed": 1,
"ignored": 17,
Expand Down
4 changes: 0 additions & 4 deletions tests/testthat/mainTests/three_years.csv

This file was deleted.

9 changes: 0 additions & 9 deletions tests/testthat/mainTests/three_years.meta.csv

This file was deleted.

6 changes: 0 additions & 6 deletions tests/testthat/test-function-mainTests.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@ test_that("time_period_six", {
expect_equal(testIndividualTest(pathStart, "time_period_six"), "FAIL")
})

# three_years -------------------------------------------------------------------------------------------------------

test_that("three_years", {
expect_equal(testIndividualTest(pathStart, "three_years"), "ADVISORY")
})

# region_for_la -------------------------------------------------------------------------------------------------------

test_that("region_for_la", {
Expand Down

0 comments on commit 4f5525a

Please sign in to comment.