Skip to content

Commit

Permalink
Add basic integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JimMadge committed Aug 9, 2024
1 parent 38fc05e commit bc5f50b
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions integration_tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions integration_tests/Rprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
local({
r <- getOption("repos")
r["CRAN"] <- "http://localhost:8080/repository/cran-proxy"
options(repos=r)
})
3 changes: 3 additions & 0 deletions integration_tests/pip.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[global]
index = http://localhost:8080/repository/pypi-proxy/pypi
index-url = http://localhost:8080/repository/pypi-proxy/simple
9 changes: 9 additions & 0 deletions integration_tests/test.sh
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions integration_tests/tests/cran.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@test "Install data.table" {
Rscript -e 'install.packages("data.table")'
}
5 changes: 5 additions & 0 deletions integration_tests/tests/pypi.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@test "Install numpy" {
python3 -m venv ./venv
. ./venv/bin/activate
pip install numpy
}

0 comments on commit bc5f50b

Please sign in to comment.