-
Notifications
You must be signed in to change notification settings - Fork 7
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
Enhancement#305 gridded global datav5 #323
base: master
Are you sure you want to change the base?
Changes from 1 commit
23b6834
33a4e93
8943c9b
cdd2294
f49e3e4
680ddfe
8497ff5
20341ed
246d291
bcdebb4
6063ecf
0eca671
c1e8dc9
c14507c
5a1cee0
41630f9
b1df9f5
6af2dc7
9229243
4c0bf91
e7d332e
1a75875
91d1f53
575e35b
bea0f35
71b714b
7ae6713
367b6aa
d73f71b
0775cb0
4b76ef7
e3e37a4
5f9f3b3
dbe6fb0
77dcc0f
684481b
0cbec09
afc2c78
364edc9
bc1c92a
4b87610
ccd634d
49bb5a2
d4caa3a
f6e42ef
9e35388
383f251
7bf10da
0b4d749
1ae4703
304e609
29981ff
3bbfdda
b21e3e3
b28734c
1b1a3fd
79c758b
87101ff
f5b3473
9e87219
2b163e3
f1bb913
be96b2c
2be512b
3731d90
1e62d13
6c772c7
ca1f319
4e9a4cb
349a4e8
2d978b8
b5daa1d
df084f4
1696fda
9226360
5f2c10d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ context("Soil data extraction") | |
# - "Error: On Travis" | ||
# Check values of the ENV variables directly as a work-around: | ||
|
||
# whether or not these tests should be run on the CIs | ||
do_skip <- c( | ||
!identical(tolower(Sys.getenv("RSFSW2_ALLTESTS")), "true"), | ||
# whereas skip_on_cran() skips if not "true", I believe it should skip only | ||
|
@@ -18,23 +19,26 @@ do_skip <- c( | |
# mimmics skip_on_appveyor(): | ||
identical(tolower(Sys.getenv("APPVEYOR")), "true")) | ||
|
||
suppressWarnings(is_online <- | ||
!inherits(try(close(url(getOption("repos"), open = "r")), silent = TRUE), | ||
"try-error")) | ||
|
||
|
||
if (!any(do_skip) && is_online) { | ||
if (!any(do_skip)) { | ||
# ============================================================================= | ||
# Tests designed to test the underlining structures created | ||
# from soil extraction functions. | ||
# ============================================================================= | ||
|
||
# set stage manually so that future changes won't cause the test to fail ====== | ||
# setup file paths | ||
fnames_in <- environment() | ||
fnames_in$fslayers <- file.path("/home/natemccauslin/Desktop/Dryland Ecology/rSFSW2/tests/test_data/TestPrj4/1_Input/SWRuns_InputData_SoilLayers_v9.csv") | ||
fnames_in$fsoils <- "/home/natemccauslin/Desktop/Dryland Ecology/rSFSW2/tests/test_data/TestPrj4/1_Input/datafiles/SWRuns_InputData_soils_v12.csv" | ||
# directory where extertnal soils data is located | ||
dir_ex_soil <- "/media/natemccauslin/SOILWAT_DATA/GIS/Data/Soils/" | ||
|
||
# if any of the file paths above are invalid, skip all tests and setup | ||
if (!all(file.exists(c(fnames_in$fslayers, fnames_in$fsoils, dir_ex_soil)))) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't check that
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having the function fail because a user doesn't have the files is correct; but having the unit tests fail because a developer doesn't have the files is bad -- the unit tests should skip. |
||
skip("File paths incorrectly configured for Soils Extraction tests") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm repeating myself Why don't you run the package tests on another machine that doesn't have
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems to work, do you mean you don't like it outside of testthat? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are correct Apparently, the devel version of Ok, I am fine with your |
||
} | ||
|
||
# set stage manually so that future changes won't cause the test to fail ====== | ||
resume <- TRUE | ||
verbose <- FALSE | ||
MMC <- environment() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why absolute paths for
fslayers
andfsoils
specific to your computer? The folderTestPrj4
is part of this package source, thus, it will always be the same and you should use a relative path, e.g., see example intest_projects.R
which usesdir_tests <- file.path("..", "test_data", "TestPrj4")