diff --git a/integration_tests/Dockerfile b/integration_tests/Dockerfile new file mode 100644 index 0000000..69190bd --- /dev/null +++ b/integration_tests/Dockerfile @@ -0,0 +1,6 @@ +FROM bats/bats + +RUN apk add --no-cache --update python3 py3-pip R +RUN mkdir -p /root/.config/pip +COPY pip.conf /root/.config/pip/pip.conf +COPY Rprofile /root/.Rprofile diff --git a/integration_tests/Rprofile b/integration_tests/Rprofile new file mode 100644 index 0000000..104c5c2 --- /dev/null +++ b/integration_tests/Rprofile @@ -0,0 +1,5 @@ +local({ + r <- getOption("repos") + r["CRAN"] <- "http://localhost:8080/repository/cran-proxy" + options(repos=r) +}) diff --git a/integration_tests/pip.conf b/integration_tests/pip.conf new file mode 100644 index 0000000..813fa8c --- /dev/null +++ b/integration_tests/pip.conf @@ -0,0 +1,3 @@ +[global] +index = http://localhost:8080/repository/pypi-proxy/pypi +index-url = http://localhost:8080/repository/pypi-proxy/simple diff --git a/integration_tests/test.sh b/integration_tests/test.sh new file mode 100755 index 0000000..ddaaaf6 --- /dev/null +++ b/integration_tests/test.sh @@ -0,0 +1,9 @@ +#! /usr/bin/env bash +docker build -t nexus_allowlist_bats:latest . +docker run \ + --rm \ + -it \ + -v "$PWD/tests:/code" \ + --network host \ + nexus_allowlist_bats:latest \ + /code diff --git a/integration_tests/tests/cran.bats b/integration_tests/tests/cran.bats new file mode 100644 index 0000000..ab5f064 --- /dev/null +++ b/integration_tests/tests/cran.bats @@ -0,0 +1,3 @@ +@test "Install data.table" { + Rscript -e 'install.packages("data.table")' +} diff --git a/integration_tests/tests/pypi.bats b/integration_tests/tests/pypi.bats new file mode 100644 index 0000000..1b9283e --- /dev/null +++ b/integration_tests/tests/pypi.bats @@ -0,0 +1,5 @@ +@test "Install numpy" { + python3 -m venv ./venv + . ./venv/bin/activate + pip install numpy +}