diff --git a/docs/source/config_files.rst b/docs/source/config_files.rst index 0de39d94e..fe7470970 100644 --- a/docs/source/config_files.rst +++ b/docs/source/config_files.rst @@ -144,9 +144,10 @@ To install your repository like an R package, you may include a ``DESCRIPTION`` file. repo2docker installs the package and dependencies from the ``DESCRIPTION`` by running ``devtools::install_local(getwd())``. -You also need to have a ``runtime.txt`` file that is formatted as -``r---
``, where YYYY-MM-DD is a snapshot of MRAN that will be -used for your R installation. +You can also have have a ``runtime.txt`` file that is formatted as +``r---
``, where YYYY-MM-DD is a snapshot of CRAN that will be used +for your R installation. If ``runtime.txt`` isn't provided in this case, a +recent date will be used. .. _postBuild: diff --git a/repo2docker/buildpacks/julia/julia_project.py b/repo2docker/buildpacks/julia/julia_project.py index 9a569e519..e6e191dc2 100644 --- a/repo2docker/buildpacks/julia/julia_project.py +++ b/repo2docker/buildpacks/julia/julia_project.py @@ -50,6 +50,16 @@ def julia_version(self): compat = project_toml["compat"]["julia"] except: # Default version which needs to be manually updated with new major.minor releases + # + # NOTE: Updates to the default version should go hand in hand with + # updates to tests/julia/project/verify where is intent to + # test the version. + # + # FIXME: When compat = "1.6" is set below and passed to + # find_semver_match, we get 1.8.2 as of 2022-10-09. We should + # clarify the desired behavior and have a unit test of + # find_semver_match to validate it. + # compat = "1.6" match = find_semver_match(compat, self.all_julias) diff --git a/repo2docker/buildpacks/r.py b/repo2docker/buildpacks/r.py index 19a38dcdb..eaf44b2b5 100644 --- a/repo2docker/buildpacks/r.py +++ b/repo2docker/buildpacks/r.py @@ -79,7 +79,7 @@ def r_version(self): # # NOTE: When updating this version, also update # - tests/unit/test_r.py -> test_version_specification - # - tests/r/simple/verify + # - tests/r/r-rspm-apt/verify # r_version = version_map["4.2"] diff --git a/tests/conda/README.md b/tests/conda/README.md new file mode 100644 index 000000000..156976194 --- /dev/null +++ b/tests/conda/README.md @@ -0,0 +1,63 @@ +# Overview of tests for the conda buildpack + +## Tested configuration files + +- [`.binder/`](https://repo2docker.readthedocs.io/en/latest/usage.html#where-to-put-configuration-files) +- [`requirements.txt`](https://repo2docker.readthedocs.io/en/latest/config_files.html#requirements-txt-install-a-python-environment) +- [`postBuild](https://repo2docker.readthedocs.io/en/latest/config_files.html#postbuild-run-code-after-installing-the-environment) + +## Tested repo2docker command line flags + +- [`--target-repo-dir`](https://repo2docker.readthedocs.io/en/latest/usage.html#cmdoption-jupyter-repo2docker-target-repo-dir) + +### py2 + +- Test setup of a Python 2 environment by declaring `python=2` in + `environment.yml`. + +### py35-binder-dir + +- Test setup of a Python 3.5 environment by declaring `python=3.5` in + `environment.yml`. + + The reasons for testing 3.5 specifically is that it is the oldest version of + Python 3 supported by repo2docker's conda buildpack. See + `repo2docker/buildpacks/conda` for details. + +- Test use of a `.binder` directory. + +### py310-requirements-file + +- Test setup of a Python 3.10 environment by declaring `python=3.10` in + `environment.yml`. + + The reasons for testing 3.10 specifically is that it is the newest version of + Python 3 supported by repo2docker's conda buildpack. See + `repo2docker/buildpacks/conda` for details. + +- Test use of a `requirements.txt` file, where an `environment.yml` file should + take precedence and the `requirements.txt` should be ignored. + +### py-r-postbuild-file + +- Test setup of the default Python environment by omitting `python` from + `environment.yml` file. + +- Test setup of the default R environment by specifying `r-base` in + `environment.yml`. + +- Test use of a `postBuild` file. + +### r3.6-target-repo-dir-flag + +- Test setup of a R 3.6 environment by specifying `r-base=3.6` in + `environment.yml`. + +- Test use of repo2docker with the `--target-repo-dir` flag. + + `--target-repo-dir` is meant to support custom paths where repositories can be + copied to besides `${HOME}`. + + This test makes use of the `test-extra-args.yaml` file to influence additional + arguments passed to `repo2docker` during the test. In this test, specify + `--target-repo-dir=/srv/repo`. diff --git a/tests/conda/binder-dir/Dockerfile b/tests/conda/binder-dir/Dockerfile deleted file mode 100644 index a742a1814..000000000 --- a/tests/conda/binder-dir/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM doesntmatter -# this file should be ignored because there's a binder dir diff --git a/tests/conda/binder-dir/environment.yml b/tests/conda/binder-dir/environment.yml deleted file mode 100644 index e0dd22713..000000000 --- a/tests/conda/binder-dir/environment.yml +++ /dev/null @@ -1,3 +0,0 @@ -dependencies: - - thiswontwork - invalid diff --git a/tests/conda/channel-dep/environment.yml b/tests/conda/channel-dep/environment.yml deleted file mode 100644 index ce7c15048..000000000 --- a/tests/conda/channel-dep/environment.yml +++ /dev/null @@ -1,6 +0,0 @@ -name: lume-model-server-demo -dependencies: - - python=3.7 - # specify a channel name in the dependency - # mamba < 0.6 doesn't handle this right - - bokeh::jupyter_bokeh==2.0.3 diff --git a/tests/conda/channel-dep/verify b/tests/conda/channel-dep/verify deleted file mode 100755 index 2fd3fc0e0..000000000 --- a/tests/conda/channel-dep/verify +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env python3 -import jupyter_bokeh diff --git a/tests/conda/default-env/postBuild b/tests/conda/default-env/postBuild deleted file mode 100644 index 980d00a0e..000000000 --- a/tests/conda/default-env/postBuild +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# install pytest with conda in the default env (should be $KERNEL_PYTHON_PREFIX) -conda install -yq pytest -# install there with pip (should be the same) -pip install there diff --git a/tests/conda/default-env/verify b/tests/conda/default-env/verify deleted file mode 100755 index 058dbed02..000000000 --- a/tests/conda/default-env/verify +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -pytest -v ./verify.py diff --git a/tests/conda/default-env/verify.py b/tests/conda/default-env/verify.py deleted file mode 100755 index ef35812e0..000000000 --- a/tests/conda/default-env/verify.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python -import os -import sys - - -def test_sys_prefix(): - # verify that pytest was installed in the notebook env - assert sys.prefix == os.environ["KERNEL_PYTHON_PREFIX"] - - -def test_there(): - # verify that there was installed in the notebook env - import there diff --git a/tests/conda/simple/environment.yml b/tests/conda/py-r-postbuild-file/environment.yml similarity index 51% rename from tests/conda/simple/environment.yml rename to tests/conda/py-r-postbuild-file/environment.yml index c8a545448..9ff3d3db8 100644 --- a/tests/conda/simple/environment.yml +++ b/tests/conda/py-r-postbuild-file/environment.yml @@ -1,3 +1,4 @@ dependencies: - - numpy - pytest + - r-base + - r-digest diff --git a/tests/conda/py-r-postbuild-file/postBuild b/tests/conda/py-r-postbuild-file/postBuild new file mode 100644 index 000000000..0d1a43346 --- /dev/null +++ b/tests/conda/py-r-postbuild-file/postBuild @@ -0,0 +1,2 @@ +#!/bin/bash +pip install there diff --git a/tests/conda/r-unspecified/verify b/tests/conda/py-r-postbuild-file/verify similarity index 58% rename from tests/conda/r-unspecified/verify rename to tests/conda/py-r-postbuild-file/verify index 9e45f3770..552036ea1 100755 --- a/tests/conda/r-unspecified/verify +++ b/tests/conda/py-r-postbuild-file/verify @@ -2,6 +2,11 @@ jupyter serverextension list 2>&1 | grep jupyter_server_proxy jupyter nbextension list 2>&1 | grep jupyter_server_proxy -R -e "library('ggplot2')" -# Fail if version is not at least 4.1 -R -e 'if (!(version$major == "4" && as.double(version$minor) >= 1)) quit("yes", 1)' + +R -e "library('digest')" + +# Fail if version is not at least 4.2 +R --version +R -e 'if (!(version$major == "4" && as.double(version$minor) >= 2)) quit("yes", 1)' + +pytest --verbose --color=yes ./verify.py diff --git a/tests/conda/simple/verify.py b/tests/conda/py-r-postbuild-file/verify.py similarity index 65% rename from tests/conda/simple/verify.py rename to tests/conda/py-r-postbuild-file/verify.py index bc6381c02..549a05a13 100755 --- a/tests/conda/simple/verify.py +++ b/tests/conda/py-r-postbuild-file/verify.py @@ -4,11 +4,13 @@ def test_sys_version(): + """The default python version should be 3.7""" assert sys.version_info[:2] == (3, 7) -def test_numpy(): - import numpy +def test_there(): + """there is to be installed via postBuild""" + import there def test_conda_activated(): diff --git a/tests/conda/simple-py2/environment.yml b/tests/conda/py2/environment.yml similarity index 100% rename from tests/conda/simple-py2/environment.yml rename to tests/conda/py2/environment.yml diff --git a/tests/conda/simple-py2/verify b/tests/conda/py2/verify similarity index 100% rename from tests/conda/simple-py2/verify rename to tests/conda/py2/verify diff --git a/tests/conda/py310-requirements-file/environment.yml b/tests/conda/py310-requirements-file/environment.yml new file mode 100644 index 000000000..192eba400 --- /dev/null +++ b/tests/conda/py310-requirements-file/environment.yml @@ -0,0 +1,6 @@ +dependencies: + - python=3.10 + - numpy + - pip + - pip: + - simplejson diff --git a/tests/conda/requirements/requirements.txt b/tests/conda/py310-requirements-file/requirements.txt similarity index 100% rename from tests/conda/requirements/requirements.txt rename to tests/conda/py310-requirements-file/requirements.txt diff --git a/tests/conda/requirements/verify b/tests/conda/py310-requirements-file/verify similarity index 78% rename from tests/conda/requirements/verify rename to tests/conda/py310-requirements-file/verify index c4767a008..622735506 100755 --- a/tests/conda/requirements/verify +++ b/tests/conda/py310-requirements-file/verify @@ -1,7 +1,7 @@ #!/usr/bin/env python import sys -assert sys.version_info[:2] == (3, 7), sys.version +assert sys.version_info[:2] == (3, 10), sys.version import numpy diff --git a/tests/conda/binder-dir/binder/environment.yml b/tests/conda/py35-binder-dir/.binder/environment.yml similarity index 100% rename from tests/conda/binder-dir/binder/environment.yml rename to tests/conda/py35-binder-dir/.binder/environment.yml diff --git a/tests/conda/py35-binder-dir/Dockerfile b/tests/conda/py35-binder-dir/Dockerfile new file mode 100644 index 000000000..255081954 --- /dev/null +++ b/tests/conda/py35-binder-dir/Dockerfile @@ -0,0 +1,2 @@ +# This file should be ignored because there's a dedicated binder folder +FROM doesntmatter diff --git a/tests/conda/py35-binder-dir/environment.yml b/tests/conda/py35-binder-dir/environment.yml new file mode 100644 index 000000000..b23ebd20c --- /dev/null +++ b/tests/conda/py35-binder-dir/environment.yml @@ -0,0 +1,4 @@ +# This file should be ignored as we have a dedicated binder folder. +dependencies: + - thiswontwork + invalid diff --git a/tests/conda/binder-dir/verify b/tests/conda/py35-binder-dir/verify similarity index 100% rename from tests/conda/binder-dir/verify rename to tests/conda/py35-binder-dir/verify diff --git a/tests/conda/py37/environment.yml b/tests/conda/py37/environment.yml deleted file mode 100644 index a26454f4a..000000000 --- a/tests/conda/py37/environment.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - python=3.7 diff --git a/tests/conda/py37/verify b/tests/conda/py37/verify deleted file mode 100755 index fe2bff503..000000000 --- a/tests/conda/py37/verify +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python -import sys - -assert sys.version_info[:2] == (3, 7), sys.version diff --git a/tests/conda/py38/environment.yml b/tests/conda/py38/environment.yml deleted file mode 100644 index c9a311f33..000000000 --- a/tests/conda/py38/environment.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - python=3.8 diff --git a/tests/conda/py38/verify b/tests/conda/py38/verify deleted file mode 100755 index af94d73c7..000000000 --- a/tests/conda/py38/verify +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python -import sys - -assert sys.version_info[:2] == (3, 8), sys.version diff --git a/tests/conda/r-unspecified/environment.yml b/tests/conda/r-unspecified/environment.yml deleted file mode 100644 index 246f3556f..000000000 --- a/tests/conda/r-unspecified/environment.yml +++ /dev/null @@ -1,3 +0,0 @@ -dependencies: - - r-base - - r-ggplot2 diff --git a/tests/conda/r3.6/environment.yml b/tests/conda/r3.6-target-repo-dir-flag/environment.yml similarity index 65% rename from tests/conda/r3.6/environment.yml rename to tests/conda/r3.6-target-repo-dir-flag/environment.yml index c1d2a2bee..e9b34a48d 100644 --- a/tests/conda/r3.6/environment.yml +++ b/tests/conda/r3.6-target-repo-dir-flag/environment.yml @@ -1,3 +1,3 @@ dependencies: - r-base=3.6 - - r-testthat + - r-digest diff --git a/tests/conda/r3.6-target-repo-dir-flag/test-extra-args.yaml b/tests/conda/r3.6-target-repo-dir-flag/test-extra-args.yaml new file mode 100644 index 000000000..c30ae2783 --- /dev/null +++ b/tests/conda/r3.6-target-repo-dir-flag/test-extra-args.yaml @@ -0,0 +1,4 @@ +# This file is respected by repo2docker's test suite, but not repo2docker +# itself. It is used solely to help us test repo2docker's command line flags. +# +- --target-repo-dir=/srv/repo diff --git a/tests/conda/r3.6/verify b/tests/conda/r3.6-target-repo-dir-flag/verify similarity index 74% rename from tests/conda/r3.6/verify rename to tests/conda/r3.6-target-repo-dir-flag/verify index 63a7165fd..bff7d8b03 100755 --- a/tests/conda/r3.6/verify +++ b/tests/conda/r3.6-target-repo-dir-flag/verify @@ -2,6 +2,11 @@ jupyter serverextension list 2>&1 | grep jupyter_server_proxy jupyter nbextension list 2>&1 | grep jupyter_server_proxy -R -e "library('testthat')" -# Fail if version is not 3.6 + +R -e "library('digest')" + +# Fail if R version is not 3.6 +R --version R -e 'if (!(version$major == "3" && as.double(version$minor) >= 6 && as.double(version$minor) < 7)) quit("yes", 1)' + +./verify.py diff --git a/tests/conda/repo-path/verify b/tests/conda/r3.6-target-repo-dir-flag/verify.py similarity index 70% rename from tests/conda/repo-path/verify rename to tests/conda/r3.6-target-repo-dir-flag/verify.py index 93f6fed67..706dc41a9 100755 --- a/tests/conda/repo-path/verify +++ b/tests/conda/r3.6-target-repo-dir-flag/verify.py @@ -10,11 +10,8 @@ assert sys.executable.startswith("/srv/conda/"), sys.executable # Repo should be in /srv/repo -assert os.path.exists("/srv/repo/verify") -assert os.path.abspath(__file__) == "/srv/repo/verify" +assert os.path.exists("/srv/repo/verify.py") +assert os.path.abspath(__file__) == "/srv/repo/verify.py" # Repo should be writable assert os.access("/srv/repo", os.W_OK) - -# We should be able to import the package in environment.yml -import numpy diff --git a/tests/conda/r4.0/environment.yml b/tests/conda/r4.0/environment.yml deleted file mode 100644 index 2fb5e3480..000000000 --- a/tests/conda/r4.0/environment.yml +++ /dev/null @@ -1,3 +0,0 @@ -dependencies: - - r-base=4.0 - - r-ggplot2 diff --git a/tests/conda/r4.0/verify b/tests/conda/r4.0/verify deleted file mode 100755 index 308dfa353..000000000 --- a/tests/conda/r4.0/verify +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -jupyter serverextension list 2>&1 | grep jupyter_server_proxy -jupyter nbextension list 2>&1 | grep jupyter_server_proxy -R -e "library('ggplot2')" -# Fail if version is not 4.0 -R -e 'if (!(version$major == "4" && as.double(version$minor) >= 0 && as.double(version$minor) < 1)) quit("yes", 1)' \ No newline at end of file diff --git a/tests/conda/r4.1/environment.yml b/tests/conda/r4.1/environment.yml deleted file mode 100644 index 479d4df78..000000000 --- a/tests/conda/r4.1/environment.yml +++ /dev/null @@ -1,3 +0,0 @@ -dependencies: - - r-base=4.1 - - r-ggplot2 diff --git a/tests/conda/r4.1/verify b/tests/conda/r4.1/verify deleted file mode 100755 index d512316e4..000000000 --- a/tests/conda/r4.1/verify +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -jupyter serverextension list 2>&1 | grep jupyter_server_proxy -jupyter nbextension list 2>&1 | grep jupyter_server_proxy -R -e "library('ggplot2')" -# Fail if version is not 4.1 -R -e 'if (!(version$major == "4" && as.double(version$minor) >= 1 && as.double(version$minor) < 2)) quit("yes", 1)' \ No newline at end of file diff --git a/tests/conda/repo-path/README.rst b/tests/conda/repo-path/README.rst deleted file mode 100644 index 1092ee6d3..000000000 --- a/tests/conda/repo-path/README.rst +++ /dev/null @@ -1,8 +0,0 @@ -Python - Custom Repository Location ------------------------------------ - -We want to support custom paths where repositories can be -copied to, instead of ${HOME}. The `extra-args.yaml` file in -each dir can contain a list of arguments that are passed -to repo2docker during the test. We copy this repo to -/srv/repo instead of ${HOME} \ No newline at end of file diff --git a/tests/conda/repo-path/environment.yml b/tests/conda/repo-path/environment.yml deleted file mode 100644 index 6a91d667f..000000000 --- a/tests/conda/repo-path/environment.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - numpy diff --git a/tests/conda/repo-path/extra-args.yaml b/tests/conda/repo-path/extra-args.yaml deleted file mode 100644 index 8687775b8..000000000 --- a/tests/conda/repo-path/extra-args.yaml +++ /dev/null @@ -1,2 +0,0 @@ -- --target-repo-dir -- /srv/repo \ No newline at end of file diff --git a/tests/conda/requirements/README.rst b/tests/conda/requirements/README.rst deleted file mode 100644 index 7fb93d745..000000000 --- a/tests/conda/requirements/README.rst +++ /dev/null @@ -1,13 +0,0 @@ -Conda - Mixed Requirements --------------------------- - -An ``environment.yml`` file takes precedence over ``requirements.txt``. -To install Python packages into a conda environment with pip, use the -``pip`` key in ``environment.yml``: - -.. sourcecode:: yaml - - dependencies: - - numpy - - pip: - - tornado diff --git a/tests/conda/requirements/environment.yml b/tests/conda/requirements/environment.yml deleted file mode 100644 index fa9404c51..000000000 --- a/tests/conda/requirements/environment.yml +++ /dev/null @@ -1,4 +0,0 @@ -dependencies: - - numpy - - pip: - - simplejson diff --git a/tests/conda/simple-py2/README.rst b/tests/conda/simple-py2/README.rst deleted file mode 100644 index 7e44b0043..000000000 --- a/tests/conda/simple-py2/README.rst +++ /dev/null @@ -1,10 +0,0 @@ -Conda Environment and Python 2 ------------------------------- - -``environment.yml`` is the standard method for defining environments with the -Anaconda (conda) distribution. Conda environment files may allow for more -complex builds and dependencies than are possible with a single -``requirements.txt`` file. - -This example shows how to define a Python 2 environment with Anaconda. You can -define any version of Python that Anaconda supports. diff --git a/tests/conda/simple/README.rst b/tests/conda/simple/README.rst deleted file mode 100644 index 9758affb7..000000000 --- a/tests/conda/simple/README.rst +++ /dev/null @@ -1,7 +0,0 @@ -Conda Environment ------------------ - -``environment.yml`` is the standard method for defining environments with the -Anaconda (conda) distribution. Conda environment files may allow for more -complex builds and dependencies than are possible with a single -``requirements.txt`` file. diff --git a/tests/conda/simple/verify b/tests/conda/simple/verify deleted file mode 100755 index 058dbed02..000000000 --- a/tests/conda/simple/verify +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -pytest -v ./verify.py diff --git a/tests/conftest.py b/tests/conftest.py index 160b3664a..46860ab2f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -198,7 +198,7 @@ def collect(self): args = ["--appendix", 'RUN echo "appendix" > /tmp/appendix'] # If there's an extra-args.yaml file in a test dir, assume it contains # a yaml list with extra arguments to be passed to repo2docker - extra_args_path = os.path.join(self.fspath.dirname, "extra-args.yaml") + extra_args_path = os.path.join(self.fspath.dirname, "test-extra-args.yaml") if os.path.exists(extra_args_path): with open(extra_args_path) as f: extra_args = yaml.safe_load(f) diff --git a/tests/julia/README.md b/tests/julia/README.md new file mode 100644 index 000000000..f6d2996f9 --- /dev/null +++ b/tests/julia/README.md @@ -0,0 +1,38 @@ +# Overview of tests for the julia buildpack + +## Tested configuration files + +- [`Project.toml`](https://repo2docker.readthedocs.io/en/latest/config_files.html#project-toml-install-a-julia-environment) +- [`REQUIRE`](https://repo2docker.readthedocs.io/en/latest/config_files.html#require-install-a-julia-environment-legacy) +- [`requirements.txt`](https://repo2docker.readthedocs.io/en/latest/config_files.html#requirements-txt-install-a-python-environment) + +## Test folders + +### project + +- Tests use of a `Project.toml` file for Julia, using the repo2docker default + version of Julia as specified in `julia_project.py`. + +### project-1.0.2 + +- Tests use of a `Project.toml` file for Julia, using a version of Julia + specified via `julia = "=1.0.2"` in `Project.toml`'s `[compat]` section. + +### require + +- Tests use of a `REQUIRE` file for Julia, using the repo2docker default version + of Julia as specified in `julia_require.py`. Note that this is default version + is currently 0.6.4! + +- Starting with Julia v0.7 and up, the package manager has changed, so this + tests that the Julia version below that can be installed correctly as well. + +### require-1-requirements-file + +- Tests use of a `REQUIRE` file for Julia, using a major version version + specification. Note that this major version specification is currently + resolving to a pinned minor and patch version as declared in + `julia_require.py`. + +- Test use of a `requirements.txt` file, where it is expected to be respected + alongside the `REQUIRE` file. diff --git a/tests/julia/julia_version-1.0.2/README.rst b/tests/julia/julia_version-1.0.2/README.rst deleted file mode 100644 index 941237688..000000000 --- a/tests/julia/julia_version-1.0.2/README.rst +++ /dev/null @@ -1,4 +0,0 @@ -Julia - Project.toml: test version for julia v1.0.2 ---------------------------------------------------- - -Test a Project.toml file for julia. diff --git a/tests/julia/julia_version-default/README.rst b/tests/julia/julia_version-default/README.rst deleted file mode 100644 index 563f676eb..000000000 --- a/tests/julia/julia_version-default/README.rst +++ /dev/null @@ -1,4 +0,0 @@ -Julia - Project.toml: test version for julia v1.1 -------------------------------------------------- - -Test a Project.toml file for julia. diff --git a/tests/julia/julialegacy_version-0.6.3/README.rst b/tests/julia/julialegacy_version-0.6.3/README.rst deleted file mode 100644 index ca4c2a711..000000000 --- a/tests/julia/julialegacy_version-0.6.3/README.rst +++ /dev/null @@ -1,22 +0,0 @@ -Julia - REQUIRE: packages and julia version number ---------------- - -To specify dependencies in Julia, include a REQUIRE file. - -To specify a version of Julia to be installed, the first line of the file must -follow the format `julia `. For example: -``` -julia 0.7 -``` - -To add package dependencies, the rest of the file can include lines that list -the names of packages you'd like to be installed. For example: - -``` -PyPlot -DataFrames -``` - -Note that `IJulia` is installed by default. - -These packages will all be installed, and then precompiled via `using`. diff --git a/tests/julia/julialegacy_version-0.6.3/REQUIRE b/tests/julia/julialegacy_version-0.6.3/REQUIRE deleted file mode 100644 index 592f0f07e..000000000 --- a/tests/julia/julialegacy_version-0.6.3/REQUIRE +++ /dev/null @@ -1,4 +0,0 @@ -julia 0.6.3 - -# Julia packages: -Compat diff --git a/tests/julia/julialegacy_version-1.0/README.rst b/tests/julia/julialegacy_version-1.0/README.rst deleted file mode 100644 index 02b8d9693..000000000 --- a/tests/julia/julialegacy_version-1.0/README.rst +++ /dev/null @@ -1,5 +0,0 @@ -Julia - REQUIRE: test version for julia v1.0 ---------------- - -Starting with julia v0.7 and up, the package manager has changed, so this tests -that the julia version can be specified and packages installed correctly. diff --git a/tests/julia/julialegacy_version-1.0/REQUIRE b/tests/julia/julialegacy_version-1.0/REQUIRE deleted file mode 100644 index 84c3b9973..000000000 --- a/tests/julia/julialegacy_version-1.0/REQUIRE +++ /dev/null @@ -1,4 +0,0 @@ -julia 1.0 - -# Julia packages: -Compat diff --git a/tests/julia/julialegacy_version-1.0/verify b/tests/julia/julialegacy_version-1.0/verify deleted file mode 100755 index 80e53b15e..000000000 --- a/tests/julia/julialegacy_version-1.0/verify +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env julia -# Verify the version: -if VERSION < v"1" || VERSION >= v"1.1" - exit(1) -end - -try - # Test that the package was installed. - using Compat - - # Verify that the environment variables are set correctly for julia 1.0+ - @assert "julia" ∈ readdir(Sys.BINDIR) -catch - exit(1) -end - -exit(0) diff --git a/tests/julia/julialegacy_version-1.1/README.rst b/tests/julia/julialegacy_version-1.1/README.rst deleted file mode 100644 index da16958aa..000000000 --- a/tests/julia/julialegacy_version-1.1/README.rst +++ /dev/null @@ -1,5 +0,0 @@ -Julia - REQUIRE: test version for julia v1.1 ---------------- - -Starting with julia v0.7 and up, the package manager has changed, so this tests -that the julia version can be specified and packages installed correctly. diff --git a/tests/julia/julialegacy_version-1.1/REQUIRE b/tests/julia/julialegacy_version-1.1/REQUIRE deleted file mode 100644 index fe324aeb0..000000000 --- a/tests/julia/julialegacy_version-1.1/REQUIRE +++ /dev/null @@ -1,4 +0,0 @@ -julia 1.1 - -# Julia packages: -Compat diff --git a/tests/julia/julialegacy_version-1.1/verify b/tests/julia/julialegacy_version-1.1/verify deleted file mode 100755 index bea7f2efd..000000000 --- a/tests/julia/julialegacy_version-1.1/verify +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env julia -# Verify the version: -if VERSION < v"1.1" || VERSION >= v"1.2" - exit(1) -end - -try - # Test that the package was installed. - using Compat - - # Verify that the environment variables are set correctly for julia 1.0+ - @assert "julia" ∈ readdir(Sys.BINDIR) -catch - exit(1) -end - -exit(0) diff --git a/tests/julia/julialegacy_version-1/README.rst b/tests/julia/julialegacy_version-1/README.rst deleted file mode 100644 index 08eb9eb9e..000000000 --- a/tests/julia/julialegacy_version-1/README.rst +++ /dev/null @@ -1,5 +0,0 @@ -Julia - REQUIRE: test version for julia v1.0 ---------------- - -Starting with julia v0.7 and up, the package manager has changed, so this tests -that the julia version can be specified and packages installed correctly. diff --git a/tests/julia/julialegacy_version-1/verify b/tests/julia/julialegacy_version-1/verify deleted file mode 100755 index 7ad47d280..000000000 --- a/tests/julia/julialegacy_version-1/verify +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env julia -# Verify the version: -if VERSION < v"1" || VERSION >= v"2" - exit(1) -end - -try - # Test that the package was installed. - using Compat - - # Verify that the environment variables are set correctly for julia 1.0+ - @assert "julia" ∈ readdir(Sys.BINDIR) -catch - exit(1) -end - -exit(0) diff --git a/tests/julia/julia_version-1.0.2/Project.toml b/tests/julia/project-1.0.2/Project.toml similarity index 100% rename from tests/julia/julia_version-1.0.2/Project.toml rename to tests/julia/project-1.0.2/Project.toml diff --git a/tests/julia/julia_version-1.0.2/verify b/tests/julia/project-1.0.2/verify similarity index 91% rename from tests/julia/julia_version-1.0.2/verify rename to tests/julia/project-1.0.2/verify index 10fd2866f..4d339a9c1 100755 --- a/tests/julia/julia_version-1.0.2/verify +++ b/tests/julia/project-1.0.2/verify @@ -1,6 +1,7 @@ #!/usr/bin/env julia -# Verify the version: + if VERSION != v"1.0.2" + println("Julia version should be 1.0.2") exit(1) end diff --git a/tests/julia/julia_version-default/Project.toml b/tests/julia/project/Project.toml similarity index 100% rename from tests/julia/julia_version-default/Project.toml rename to tests/julia/project/Project.toml diff --git a/tests/julia/julia_version-default/verify b/tests/julia/project/verify similarity index 61% rename from tests/julia/julia_version-default/verify rename to tests/julia/project/verify index 6a5cd226b..75b5d89f0 100755 --- a/tests/julia/julia_version-default/verify +++ b/tests/julia/project/verify @@ -1,8 +1,13 @@ #!/usr/bin/env julia -# Verify the version: -if VERSION < v"1.1.0" - exit(1) -end + +# FIXME: The default version set by repo2docker is in practice the latest +# available, but from the julia_project.py file that doesn't seem +# intented. +# +# if ! (VERSION >= v"1.6" && VERSION < v"1.7") +# println("Default Julia version should be at 1.6.x") +# exit(1) +# end try # Test that the package was installed. diff --git a/tests/julia/pyplot-requirements/README.rst b/tests/julia/pyplot-requirements/README.rst deleted file mode 100644 index 38bc2e572..000000000 --- a/tests/julia/pyplot-requirements/README.rst +++ /dev/null @@ -1,17 +0,0 @@ -Julia - REQUIRE ---------------- - -To specify dependencies in Julia, include a REQUIRE file that lists the names -of packages you'd like to be installed. For example: - -``` -PyPlot -IJulia -DataFrames -``` - -Each one will be installed but **not** pre-compiled. If you'd like to -pre-compile your Julia packages, consider using a ``postBuild`` file. - -Note that this example also specifies Python dependencies with an -``requirements.txt`` file. diff --git a/tests/julia/pyplot-requirements/REQUIRE b/tests/julia/pyplot-requirements/REQUIRE deleted file mode 100644 index f858f97a9..000000000 --- a/tests/julia/pyplot-requirements/REQUIRE +++ /dev/null @@ -1 +0,0 @@ -PyPlot diff --git a/tests/julia/pyplot-requirements/verify b/tests/julia/pyplot-requirements/verify deleted file mode 100755 index 9f6781f16..000000000 --- a/tests/julia/pyplot-requirements/verify +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env julia -using PyPlot - -# Make sure we are re-using the same conda python -if ! startswith(PyCall.libpython, ENV["NB_PYTHON_PREFIX"] * "/lib") - println("Not re-using conda python! Using " * PyCall.libpython * " instead") - exit(1) -end - -# We try to plot something, and see if the file saved exists -x = linspace(0,2*pi,1000); y = sin(3*x + 4*cos(2*x)) -plot(x, y, color="red", linewidth=2.0, linestyle="--") -savefig("graph.png") -if isfile("graph.png") - exit(0) -else - exit(1) -end - -# We check that PyPlot is installed inside ${JULIA_DEPOT_PATH} -if ! isdir(ENV["JULIA_DEPOT_PATH"] * "/packages/PyPlot") - println("PyPlot not installed under JULIA_DEPOT_PATH") - exit(1) -end diff --git a/tests/julia/require-1-requirements-file/REQUIRE b/tests/julia/require-1-requirements-file/REQUIRE new file mode 100644 index 000000000..1d95307f2 --- /dev/null +++ b/tests/julia/require-1-requirements-file/REQUIRE @@ -0,0 +1,5 @@ +julia 1 + +# Julia packages: +PyCall +PyPlot diff --git a/tests/julia/pyplot-requirements/requirements.txt b/tests/julia/require-1-requirements-file/requirements.txt similarity index 100% rename from tests/julia/pyplot-requirements/requirements.txt rename to tests/julia/require-1-requirements-file/requirements.txt diff --git a/tests/julia/require-1-requirements-file/verify b/tests/julia/require-1-requirements-file/verify new file mode 100755 index 000000000..3e55195de --- /dev/null +++ b/tests/julia/require-1-requirements-file/verify @@ -0,0 +1,34 @@ +#!/usr/bin/env julia +using PyCall +using PyPlot + +if ! (VERSION >= v"1" && VERSION < v"2") + println("Julia version was: ", VERSION) + println("Julia version expected to be 1.x when pinned to 1 in a REQUIRE file") + exit(1) +end + +# Make sure we are re-using the same conda python +if ! startswith(PyCall.libpython, ENV["NB_PYTHON_PREFIX"] * "/lib") + println("Not re-using conda python! Using " * PyCall.libpython * " instead") + exit(1) +end + +# We check that PyPlot is installed inside ${JULIA_DEPOT_PATH} +if ! isdir(ENV["JULIA_DEPOT_PATH"] * "/packages/PyPlot") + println("PyPlot not installed under JULIA_DEPOT_PATH") + exit(1) +end + +# FIXME: Julia code that worked before v1, but now fails with: +# +# ERROR: LoadError: UndefVarError: linspace not defined +# +# x = linspace(0,2*pi,1000); y = sin(3*x + 4*cos(2*x)) +# plot(x, y, color="red", linewidth=2.0, linestyle="--") +# savefig("graph.png") +# if isfile("graph.png") +# exit(0) +# else +# exit(1) +# end diff --git a/tests/julia/julialegacy_version-1/REQUIRE b/tests/julia/require/REQUIRE similarity index 73% rename from tests/julia/julialegacy_version-1/REQUIRE rename to tests/julia/require/REQUIRE index 5bae03070..f77f67e60 100644 --- a/tests/julia/julialegacy_version-1/REQUIRE +++ b/tests/julia/require/REQUIRE @@ -1,4 +1,2 @@ -julia 1 - # Julia packages: Compat diff --git a/tests/julia/julialegacy_version-0.6.3/verify b/tests/julia/require/verify similarity index 58% rename from tests/julia/julialegacy_version-0.6.3/verify rename to tests/julia/require/verify index 0861a8321..73851db68 100755 --- a/tests/julia/julialegacy_version-0.6.3/verify +++ b/tests/julia/require/verify @@ -1,6 +1,8 @@ #!/usr/bin/env julia -# Verify the version: -if VERSION != v"0.6.3" + +if VERSION != v"0.6.4" + println("Julia version was: ", VERSION) + println("Default Julia version expected to be 0.6.4 when unspecified in a REQUIRE file") exit(1) end @@ -8,7 +10,7 @@ try # Test that the package was installed. using Compat - # Verify that the environment variables are set correctly for julia <= 0.6 + # Verify that the environment variables are set correctly for julia < 0.7 @assert "julia" ∈ readdir(Base.JULIA_HOME) catch exit(1) diff --git a/tests/r/README.md b/tests/r/README.md new file mode 100644 index 000000000..61df6db48 --- /dev/null +++ b/tests/r/README.md @@ -0,0 +1,43 @@ +# Overview of tests for the R buildpack + +## Tested configuration files + +- [`runtime.txt`](https://repo2docker.readthedocs.io/en/latest/config_files.html#runtime-txt-specifying-runtimes). +- [`DESCRIPTION`](https://repo2docker.readthedocs.io/en/latest/config_files.html#description-install-an-r-package). +- [`install.R`](https://repo2docker.readthedocs.io/en/latest/config_files.html#install-r-install-an-r-rstudio-environment). +- [`requirements.txt`](https://repo2docker.readthedocs.io/en/latest/config_files.html#requirements-txt-install-a-python-environment) +- [`apt.txt`](https://repo2docker.readthedocs.io/en/latest/config_files.html#apt-txt-install-packages-with-apt-get) + +## Test folders + +### r-rspm-apt-file + +- Test setup of the default R environment by omitting a version specification in + `runtime.txt`, where the date provided in `runtime.txt` is recent enough for a + RSPM snapshot of CRAN to be used. + +- Test use of a `apt.txt` file. + +### r-rspm-description-file + +- Test use of a `DESCRIPTION` file instead of an `install.R` file, where a + `runtime.txt` is omitted and a recent enough snapshot date is assumed a RSPM + snapshot of CRAN to be used. + +### r3.6-mran + +- Test setup of a R 3.6 environment by specifying `r-3.6-...` in `runtime.txt`, + where the date provided in `runtime.txt` is old enough for a MRAN snapshot of + CRAN to be used. + +### r4.0-mran + +- Test setup of a R 4.0 environment by specifying `r-4.0-...` in `runtime.txt`, + where the date provided in `runtime.txt` is old enough for a MRAN snapshot of + CRAN to be used. + +### r4.0-rspm + +- Test setup of a R 4.0 environment by specifying `r-4.0-...` in `runtime.txt`, + where the date provided in `runtime.txt` is recent enough for a RSPM snapshot + of CRAN to be used. diff --git a/tests/r/apt/install.R b/tests/r/apt/install.R deleted file mode 100644 index 8b43883c0..000000000 --- a/tests/r/apt/install.R +++ /dev/null @@ -1 +0,0 @@ -install.packages("viridisLite") diff --git a/tests/r/apt/runtime.txt b/tests/r/apt/runtime.txt deleted file mode 100644 index a05a61215..000000000 --- a/tests/r/apt/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -r-4.1-2021-10-22 diff --git a/tests/r/description-file/README.md b/tests/r/description-file/README.md deleted file mode 100644 index 0b843ac4c..000000000 --- a/tests/r/description-file/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Test that `repo2docker` will build an R package - -If a `DESCRIPTION` file is present along with an `R`-requiring `runtime.txt` -, repo2docker should build the R package that is in the repository. diff --git a/tests/r/mran/install.R b/tests/r/mran/install.R deleted file mode 100644 index b4fdeb90e..000000000 --- a/tests/r/mran/install.R +++ /dev/null @@ -1 +0,0 @@ -install.packages("testthat") diff --git a/tests/r/apt/apt.txt b/tests/r/r-rspm-apt-file/apt.txt similarity index 100% rename from tests/r/apt/apt.txt rename to tests/r/r-rspm-apt-file/apt.txt diff --git a/tests/r/r-rspm-apt-file/install.R b/tests/r/r-rspm-apt-file/install.R new file mode 100644 index 000000000..f609959ef --- /dev/null +++ b/tests/r/r-rspm-apt-file/install.R @@ -0,0 +1 @@ +install.packages("digest") diff --git a/tests/r/r-rspm-apt-file/runtime.txt b/tests/r/r-rspm-apt-file/runtime.txt new file mode 100644 index 000000000..aa35fc0b3 --- /dev/null +++ b/tests/r/r-rspm-apt-file/runtime.txt @@ -0,0 +1 @@ +r-2022-06-23 diff --git a/tests/r/r-rspm-apt-file/verify b/tests/r/r-rspm-apt-file/verify new file mode 100755 index 000000000..f7040319f --- /dev/null +++ b/tests/r/r-rspm-apt-file/verify @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail + +./verify.sh +./verify.r diff --git a/tests/r/simple/verify b/tests/r/r-rspm-apt-file/verify.r similarity index 56% rename from tests/r/simple/verify rename to tests/r/r-rspm-apt-file/verify.r index bab06b4e4..30117134a 100755 --- a/tests/r/simple/verify +++ b/tests/r/r-rspm-apt-file/verify.r @@ -1,7 +1,9 @@ #!/usr/bin/env Rscript -library('testthat') +library('digest') -# Fail if version is not 4.2 + +# Fail if version isn't 4.2, the default version for the RBuildPack +print(version) if (!(version$major == "4" && as.double(version$minor) >= 2 && as.double(version$minor) < 3)) { quit("yes", 1) -} \ No newline at end of file +} diff --git a/tests/r/apt/verify b/tests/r/r-rspm-apt-file/verify.sh similarity index 72% rename from tests/r/apt/verify rename to tests/r/r-rspm-apt-file/verify.sh index 636a3374d..152b30475 100755 --- a/tests/r/apt/verify +++ b/tests/r/r-rspm-apt-file/verify.sh @@ -1,6 +1,5 @@ #!/usr/bin/env bash set -euo pipefail + apt list apt list | grep libsodium-dev -# make sure we got R -which R diff --git a/tests/r/description-file/DESCRIPTION b/tests/r/r-rspm-description-file/DESCRIPTION similarity index 93% rename from tests/r/description-file/DESCRIPTION rename to tests/r/r-rspm-description-file/DESCRIPTION index 4571be162..2c51fc3c7 100644 --- a/tests/r/description-file/DESCRIPTION +++ b/tests/r/r-rspm-description-file/DESCRIPTION @@ -1,6 +1,6 @@ Package: binderdescription Version: 0.1 -Date: 2018-09-18 +Date: 2022-06-23 Title: Binder R DESCRIPTION support Description: Test that automatically building R packages works Author: Bastian Greshake Tzovaras diff --git a/tests/r/description-file/NAMESPACE b/tests/r/r-rspm-description-file/NAMESPACE similarity index 100% rename from tests/r/description-file/NAMESPACE rename to tests/r/r-rspm-description-file/NAMESPACE diff --git a/tests/r/description-file/R/print_something.R b/tests/r/r-rspm-description-file/R/print_something.R similarity index 100% rename from tests/r/description-file/R/print_something.R rename to tests/r/r-rspm-description-file/R/print_something.R diff --git a/tests/r/description-file/verify b/tests/r/r-rspm-description-file/verify similarity index 100% rename from tests/r/description-file/verify rename to tests/r/r-rspm-description-file/verify diff --git a/tests/r/r3.6-mran/install.R b/tests/r/r3.6-mran/install.R new file mode 100644 index 000000000..f609959ef --- /dev/null +++ b/tests/r/r3.6-mran/install.R @@ -0,0 +1 @@ +install.packages("digest") diff --git a/tests/r/mran/runtime.txt b/tests/r/r3.6-mran/runtime.txt similarity index 100% rename from tests/r/mran/runtime.txt rename to tests/r/r3.6-mran/runtime.txt diff --git a/tests/r/mran/verify b/tests/r/r3.6-mran/verify similarity index 53% rename from tests/r/mran/verify rename to tests/r/r3.6-mran/verify index b15da1547..26f561028 100755 --- a/tests/r/mran/verify +++ b/tests/r/r3.6-mran/verify @@ -1,7 +1,11 @@ #!/usr/bin/env Rscript -library('testthat') +library('digest') +# Fail if version is not 3.6 print(version) +if (!(version$major == "3" && as.double(version$minor) >= 6 && as.double(version$minor) < 7)) { + quit("yes", 1) +} # Fail if MRAN isn't the configured CRAN mirror if (!(startsWith(options()$repos["CRAN"], "https://mran.microsoft.com"))) { diff --git a/tests/r/r3.6/install.R b/tests/r/r3.6/install.R deleted file mode 100644 index b4fdeb90e..000000000 --- a/tests/r/r3.6/install.R +++ /dev/null @@ -1 +0,0 @@ -install.packages("testthat") diff --git a/tests/r/r3.6/runtime.txt b/tests/r/r3.6/runtime.txt deleted file mode 100644 index 50ebaa6a3..000000000 --- a/tests/r/r3.6/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -r-3.6-2018-07-07 diff --git a/tests/r/r3.6/verify b/tests/r/r3.6/verify deleted file mode 100755 index 42f33de32..000000000 --- a/tests/r/r3.6/verify +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env Rscript -library('testthat') - -print(version) -# Fail if version is not 3.6 -if (!(version$major == "3" && as.double(version$minor) >= 6 && as.double(version$minor) < 7)) { - quit("yes", 1) -} diff --git a/tests/r/r4.0-mran/install.R b/tests/r/r4.0-mran/install.R new file mode 100644 index 000000000..f609959ef --- /dev/null +++ b/tests/r/r4.0-mran/install.R @@ -0,0 +1 @@ +install.packages("digest") diff --git a/tests/r/r4.0/runtime.txt b/tests/r/r4.0-mran/runtime.txt similarity index 100% rename from tests/r/r4.0/runtime.txt rename to tests/r/r4.0-mran/runtime.txt diff --git a/tests/r/r4.0/verify b/tests/r/r4.0-mran/verify similarity index 94% rename from tests/r/r4.0/verify rename to tests/r/r4.0-mran/verify index d715cb38d..b821ec6cc 100755 --- a/tests/r/r4.0/verify +++ b/tests/r/r4.0-mran/verify @@ -1,8 +1,8 @@ #!/usr/bin/env Rscript -library('testthat') +library('digest') -print(version) # Fail if version is not 4.0 +print(version) if (!(version$major == "4" && as.double(version$minor) >= 0 && as.double(version$minor) < 1)) { quit("yes", 1) } diff --git a/tests/r/r4.0-rspm/install.R b/tests/r/r4.0-rspm/install.R index b4fdeb90e..f609959ef 100644 --- a/tests/r/r4.0-rspm/install.R +++ b/tests/r/r4.0-rspm/install.R @@ -1 +1 @@ -install.packages("testthat") +install.packages("digest") diff --git a/tests/r/r4.0-rspm/verify b/tests/r/r4.0-rspm/verify index 091739e2c..21bac29d8 100755 --- a/tests/r/r4.0-rspm/verify +++ b/tests/r/r4.0-rspm/verify @@ -1,8 +1,8 @@ #!/usr/bin/env Rscript -library('testthat') +library('digest') -print(version) # Fail if version is not 4.0 +print(version) if (!(version$major == "4" && as.double(version$minor) >= 0 && as.double(version$minor) < 1)) { quit("yes", 1) } diff --git a/tests/r/r4.0/install.R b/tests/r/r4.0/install.R deleted file mode 100644 index b4fdeb90e..000000000 --- a/tests/r/r4.0/install.R +++ /dev/null @@ -1 +0,0 @@ -install.packages("testthat") diff --git a/tests/r/r4.1/install.R b/tests/r/r4.1/install.R deleted file mode 100644 index b4fdeb90e..000000000 --- a/tests/r/r4.1/install.R +++ /dev/null @@ -1 +0,0 @@ -install.packages("testthat") diff --git a/tests/r/r4.1/runtime.txt b/tests/r/r4.1/runtime.txt deleted file mode 100644 index a05a61215..000000000 --- a/tests/r/r4.1/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -r-4.1-2021-10-22 diff --git a/tests/r/r4.1/verify b/tests/r/r4.1/verify deleted file mode 100755 index c390f2706..000000000 --- a/tests/r/r4.1/verify +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env Rscript -library('testthat') - -# Fail if version is not 4.1 -if (!(version$major == "4" && as.double(version$minor) >= 1 && as.double(version$minor) < 2)) { - quit("yes", 1) -} - -# R 4.1 always uses rspm snapshots -if (!(startsWith(options()$repos["CRAN"], "https://packagemanager.rstudio.com"))) { - quit("yes", 1) -} diff --git a/tests/r/simple/README.rst b/tests/r/simple/README.rst deleted file mode 100644 index d4f81aa16..000000000 --- a/tests/r/simple/README.rst +++ /dev/null @@ -1,19 +0,0 @@ -R environment - install.R -------------------------- - -You can install an R, RStudio, and IRKernel environment with the following -two files: - -* A ``runtime.txt`` file with the text:: - - r-YYYY-MM-DD - - Where 'YYYY', 'MM' and 'DD' refer to a specific - date snapshot of https://mran.microsoft.com/timemachine - from which libraries will be installed. -* An optional ``install.R`` file that will be executed by an R installation - at build time. It can be used for installing packages from MRAN or GitHub. - -The presence of ``runtime.txt`` is enough to set up R, RStudio, and IRKernel. It -uses the ``r-base`` package from the Ubuntu apt repositories to install -R itself. diff --git a/tests/r/simple/install.R b/tests/r/simple/install.R deleted file mode 100644 index b4fdeb90e..000000000 --- a/tests/r/simple/install.R +++ /dev/null @@ -1 +0,0 @@ -install.packages("testthat") diff --git a/tests/r/simple/runtime.txt b/tests/r/simple/runtime.txt deleted file mode 100644 index 9be9b66ee..000000000 --- a/tests/r/simple/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -r-2020-07-07