From bc853752542f907223f9ecf7aa53d928eb268fb3 Mon Sep 17 00:00:00 2001 From: eitsupi <50911393+eitsupi@users.noreply.github.com> Date: Sun, 12 May 2024 05:44:18 +0000 Subject: [PATCH] test: add more tests --- test/r-dependent-packages/r-ver-postcreate.sh | 13 +++++++++++++ .../r-ver-postcreate/DESCRIPTION | 5 +++++ .../r-ver-updatecontent.sh | 13 +++++++++++++ .../r-ver-updatecontent/DESCRIPTION | 5 +++++ test/r-dependent-packages/scenarios.json | 18 ++++++++++++++++++ 5 files changed, 54 insertions(+) create mode 100755 test/r-dependent-packages/r-ver-postcreate.sh create mode 100644 test/r-dependent-packages/r-ver-postcreate/DESCRIPTION create mode 100755 test/r-dependent-packages/r-ver-updatecontent.sh create mode 100644 test/r-dependent-packages/r-ver-updatecontent/DESCRIPTION diff --git a/test/r-dependent-packages/r-ver-postcreate.sh b/test/r-dependent-packages/r-ver-postcreate.sh new file mode 100755 index 0000000..a685a48 --- /dev/null +++ b/test/r-dependent-packages/r-ver-postcreate.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -e + +# Optional: Import test library bundled with the devcontainer CLI +source dev-container-features-test-lib + +# Feature-specific tests +check "R cli package" bash -c "R -q -e 'names(installed.packages()[, 3])' | grep cli" +check "R rlang package" bash -c "R -q -e 'names(installed.packages()[, 3])' | grep rlang" + +# Report result +reportResults diff --git a/test/r-dependent-packages/r-ver-postcreate/DESCRIPTION b/test/r-dependent-packages/r-ver-postcreate/DESCRIPTION new file mode 100644 index 0000000..105e8fa --- /dev/null +++ b/test/r-dependent-packages/r-ver-postcreate/DESCRIPTION @@ -0,0 +1,5 @@ +Package: foo +Version: 0.0.0.9000 +Suggests: + cli, + rlang diff --git a/test/r-dependent-packages/r-ver-updatecontent.sh b/test/r-dependent-packages/r-ver-updatecontent.sh new file mode 100755 index 0000000..a685a48 --- /dev/null +++ b/test/r-dependent-packages/r-ver-updatecontent.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -e + +# Optional: Import test library bundled with the devcontainer CLI +source dev-container-features-test-lib + +# Feature-specific tests +check "R cli package" bash -c "R -q -e 'names(installed.packages()[, 3])' | grep cli" +check "R rlang package" bash -c "R -q -e 'names(installed.packages()[, 3])' | grep rlang" + +# Report result +reportResults diff --git a/test/r-dependent-packages/r-ver-updatecontent/DESCRIPTION b/test/r-dependent-packages/r-ver-updatecontent/DESCRIPTION new file mode 100644 index 0000000..105e8fa --- /dev/null +++ b/test/r-dependent-packages/r-ver-updatecontent/DESCRIPTION @@ -0,0 +1,5 @@ +Package: foo +Version: 0.0.0.9000 +Suggests: + cli, + rlang diff --git a/test/r-dependent-packages/scenarios.json b/test/r-dependent-packages/scenarios.json index 362d145..be5914d 100644 --- a/test/r-dependent-packages/scenarios.json +++ b/test/r-dependent-packages/scenarios.json @@ -6,5 +6,23 @@ "manifestRoot": ".devcontainer" } } + }, + "r-ver-postcreate": { + "image": "rocker/r-ver:4", + "features": { + "r-dependent-packages": { + "manifestRoot": ".devcontainer", + "when": "postCreate" + } + } + }, + "r-ver-updatecontent": { + "image": "rocker/r-ver:4", + "features": { + "r-dependent-packages": { + "manifestRoot": ".devcontainer", + "when": "updateContent" + } + } } }