diff --git a/.github/workflows/automatedTests.yaml b/.github/workflows/automatedTests.yaml index 82390a1..be7a73c 100644 --- a/.github/workflows/automatedTests.yaml +++ b/.github/workflows/automatedTests.yaml @@ -24,6 +24,15 @@ 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 @@ -31,4 +40,4 @@ jobs: shell: Rscript {0} run: | shinytest2::test_app() - \ No newline at end of file + diff --git a/R/mainTests.r b/R/mainTests.r index 5a8cb33..f659217 100644 --- a/R/mainTests.r +++ b/R/mainTests.r @@ -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 @@ -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.
- 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 diff --git a/tests/testthat/_snaps/UI-01_example_files/example_files-002.json b/tests/testthat/_snaps/UI-01_example_files/example_files-002.json index 412b2bf..ae29d34 100644 --- a/tests/testthat/_snaps/UI-01_example_files/example_files-002.json +++ b/tests/testthat/_snaps/UI-01_example_files/example_files-002.json @@ -214,7 +214,7 @@ } }, "export": { - "advisory": 1, + "advisory": 0, "ancillary": 1, "failed": 1, "ignored": 17, diff --git a/tests/testthat/mainTests/three_years.csv b/tests/testthat/mainTests/three_years.csv deleted file mode 100644 index 2c2f383..0000000 --- a/tests/testthat/mainTests/three_years.csv +++ /dev/null @@ -1,4 +0,0 @@ -time_period,time_identifier,geographic_level,country_code,country_name,school_type,num_schools,enrolments,sess_overall_percent,sess_authorised_percent,sess_unauthorised_percent,enrolments_pa_10_exact,enrolments_pa_10_exact_percent -201718,Academic year,National,E92000001,England,Total,20121,6835059,4.20821,3.01996,1.18824,731047,10.69555 -201718,Academic year,National,E92000001,England,State-funded primary,16739,3885774,3.68934,2.69421,0.99512,357742,9.20645 -201718,Academic year,National,E92000001,England,State-funded secondary,3382,2949285,4.89899,3.45364,1.44535,373305,12.65747 diff --git a/tests/testthat/mainTests/three_years.meta.csv b/tests/testthat/mainTests/three_years.meta.csv deleted file mode 100644 index 22ef0ba..0000000 --- a/tests/testthat/mainTests/three_years.meta.csv +++ /dev/null @@ -1,9 +0,0 @@ -col_name,col_type,label,indicator_grouping,indicator_unit,indicator_dp,filter_hint,filter_grouping_column -num_schools,Indicator,Number of schools,Absence fields,,0,, -enrolments,Indicator,Number of pupil enrolments,Absence fields,,0,, -sess_overall_percent,Indicator,Overall absence rate,Absence fields,%,0,, -sess_authorised_percent,Indicator,Authorised absence rate,Absence fields,%,1,, -sess_unauthorised_percent,Indicator,Unauthorised absence rate,Absence fields,%,2,, -enrolments_pa_10_exact,Indicator,Number of persistent absentees,Absence fields,,0,, -enrolments_pa_10_exact_percent,Indicator,Percentage of persistent absentees,Absence fields,%,3,, -school_type,Filter,School type,,,,Filter by school type, diff --git a/tests/testthat/test-function-mainTests.R b/tests/testthat/test-function-mainTests.R index b98e47d..c78e128 100644 --- a/tests/testthat/test-function-mainTests.R +++ b/tests/testthat/test-function-mainTests.R @@ -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", {