From 96295ca418f8414b93aae763343d03c2ddbdd5dd Mon Sep 17 00:00:00 2001 From: Steven Maude Date: Thu, 9 May 2024 13:29:18 +0100 Subject: [PATCH] Expand test script --- tests/dev_container.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/dev_container.sh b/tests/dev_container.sh index bb62f5b..6fe6971 100755 --- a/tests/dev_container.sh +++ b/tests/dev_container.sh @@ -1,2 +1,23 @@ -#!/bin/sh +#!/bin/bash +set -euxo pipefail + +# Check that we are the rstudio user. +[ "$(whoami)" == "rstudio" ] + +# Check the OpenSAFELY research-template example runs. opensafely run run_all + +# Check the Python packages are as the Python image from which they are taken. +python_image_version="v2" +opensafely pull "python:$python_image_version" + +docker_python_packages=$(docker run ghcr.io/opensafely-core/python:$python_image_version python -m pip freeze) +local_python_packages=$(/opt/venv/bin/python3.10 -m pip freeze) +diff <(echo "$local_python_packages") <(echo "$docker_python_packages") + +# Check the RStudio server is running. +curl -L http://localhost:8787 | grep "RStudio" + +# Check the RStudio server installation +sudo rstudio-server stop +sudo rstudio-server verify-installation