Skip to content

Commit

Permalink
Merge pull request #98 from PIFSCstockassessments/97-bug-tests-are-fa…
Browse files Browse the repository at this point in the history
…iling

remove download ss from R-CMD-check.yml and download in testthat.R
  • Loading branch information
MOshima-PIFSC authored Feb 2, 2024
2 parents e123bc9 + 79bf20f commit 24fe080
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 75 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,6 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Get the latest SS3 executable for linux and move to expected location
if: matrix.config.os == 'ubuntu-latest'
run: |
curl https://api.github.com/repos/nmfs-stock-synthesis/stock-synthesis/releases/latest | grep "browser_download_url" | grep -Eo 'https://[^\"]*' | grep "ss_linux" | xargs wget
mv ss_linux ss
sudo chmod a+x ss
cp ss inst/extdata/ss
rm ss
- name: Get the latest SS3 executable for windows and move to expected location
if: matrix.config.os == 'windows-latest'
run: |
Invoke-WebRequest -Uri https://github.com/nmfs-stock-synthesis/stock-synthesis/releases/download/v3.30.21/ss_win.exe -Outfile "D:\a\ss3diags\ss3diags\ss_win.exe"
mv ss_win.exe ss.exe
cp ss.exe inst/extdata/ss.exe
- uses: nick-fields/retry@v2
if: matrix.config.os == 'macOS-latest'
with:
timeout_minutes: 3
max_attempts: 3
retry_on: error
command: |
curl https://api.github.com/repos/nmfs-stock-synthesis/stock-synthesis/releases/latest | grep "browser_download_url" | grep -Eo 'https://[^\"]*' | grep "ss_osx" | xargs wget
mv ss_osx ss
sudo chmod a+x ss
cp ss inst/extdata/ss
rm ss

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -76,15 +47,6 @@ jobs:
with:
error-on: '"error"'

- name: remove ss executable
run: |
if ["$RUNNER_OS" == "Linux" ]; then
rm inst/extdata/ss.exe
else
rm inst/extdata/ss
fi
shell: bash




Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ Encoding: UTF-8
LazyData: True
LazyDataCompression: gzip
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
4 changes: 2 additions & 2 deletions tests/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ files_path <- system.file("extdata", package = "ss3diags")
run_tmp <- file.path(tempdir(check = TRUE), "test-runs")
dir.create(run_tmp, showWarnings = FALSE)
file.copy(from = list.files(files_path, full.names = TRUE), to = run_tmp)

r4ss::get_ss3_exe(dir = run_tmp, version = "v3.30.21")
## Run retrospectives
if (file.exists(file.path(files_path, "ss")) | file.exists(file.path(files_path, "ss.exe"))) {
if (file.exists(file.path(run_tmp, "ss3")) | file.exists(file.path(run_tmp, "ss3.exe"))) {
r4ss::retro(dir = run_tmp, oldsubdir = "", newsubdir = "retrospectives", years = 0:-3, show_in_console = FALSE)
# Creating retrospective object here so that multiple test files can access it without having to re-run retrospective for each test
retroModels <- r4ss::SSgetoutput(
Expand Down
31 changes: 0 additions & 31 deletions tests/testthat/SSmase_test.R

This file was deleted.

3 changes: 0 additions & 3 deletions tests/testthat/test-HCxval.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
## Test script for hindcast cross validation and MASE

# retroSimple <- ss3diags::retroSimple
# retrosum.simple <- r4ss::SSsummarize(retroSimple)

path <- file.path(tempdir(), "test_runs")
dir.create(path, showWarnings = FALSE)

Expand Down

0 comments on commit 24fe080

Please sign in to comment.