diff --git a/.dockerignore b/.dockerignore index 6cf218f..6b8710a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1 @@ -** -!Dockerfile* -!test*.sh +.git diff --git a/.env b/.env index 3f241e6..deab684 100644 --- a/.env +++ b/.env @@ -4,7 +4,8 @@ # From: /environments/snapshot.env -RACKET_VERSION=6.11.0.2 +COMPOSE_PROJECT_NAME=racketrelease +RACKET_VERSION=6.11.0.6 RACKET_INSTALLER_HOST=www.cs.utah.edu RACKET_INSTALLER_PATH_PREFIX=/plt/snapshots/current/installers diff --git a/.travis.yml b/.travis.yml index 077b371..07a2460 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,67 @@ sudo: required +# Test pushes to master and pull requests to master, but don't test other +# branches. Without this, pushing to a same-repository PR causes Travis to run +# everything twice. +branches: + only: + - "master" + env: - - INSTALLATION=racket-x86 - - INSTALLATION=racket-x86-minimal + - | + INSTALLER_TYPE=linux-64-ospkg-full + INSTALLATION_TYPE=script-inplace + TEST_SUITE=nogui + - | + INSTALLER_TYPE=linux-64-ospkg-minimal + INSTALLATION_TYPE=script-inplace + TEST_SUITE=nogui + - | + INSTALLER_TYPE=linux-64-natipkg-full + INSTALLATION_TYPE=script-inplace + TEST_SUITE=nogui + - | + INSTALLER_TYPE=linux-64-natipkg-minimal + INSTALLATION_TYPE=script-inplace + TEST_SUITE=nogui + - | + INSTALLER_TYPE=linux-64-ospkg-full + INSTALLATION_TYPE=script-inplace + TEST_SUITE=gui + - | + INSTALLER_TYPE=linux-64-ospkg-minimal + INSTALLATION_TYPE=script-inplace + TEST_SUITE=gui + - | + INSTALLER_TYPE=linux-64-natipkg-full + INSTALLATION_TYPE=script-inplace + TEST_SUITE=gui + - | + INSTALLER_TYPE=linux-64-natipkg-minimal + INSTALLATION_TYPE=script-inplace + TEST_SUITE=gui # Temporarily disabled due to Typed Racket GUI test failures related to # extflonums and 32-bit builds, see racket/typed-racket#652 - # - INSTALLATION=racket-i386 - # - INSTALLATION=racket-i386-minimal - - INSTALLATION=racket-x86-natipkg - - INSTALLATION=racket-x86-natipkg-minimal + # - | + # INSTALLER_TYPE=linux-32-ospkg-full + # INSTALLATION_TYPE=script-inplace + # TEST_SUITE=nogui + # RACKET_BASE_IMAGE=i386/buildpack-deps:jessie + # - | + # INSTALLER_TYPE=linux-32-ospkg-minimal + # INSTALLATION_TYPE=script-inplace + # TEST_SUITE=nogui + # RACKET_BASE_IMAGE=i386/buildpack-deps:jessie + # - | + # INSTALLER_TYPE=linux-32-ospkg-full + # INSTALLATION_TYPE=script-inplace + # TEST_SUITE=gui + # RACKET_BASE_IMAGE=i386/buildpack-deps:jessie + # - | + # INSTALLER_TYPE=linux-32-ospkg-minimal + # INSTALLATION_TYPE=script-inplace + # TEST_SUITE=gui + # RACKET_BASE_IMAGE=i386/buildpack-deps:jessie services: - docker @@ -19,13 +72,16 @@ before_install: - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - sudo apt-get update - sudo apt-get -y install docker-ce + # We build these in before_install because they're prerequisite services and + # tools, not the installer itself + - docker-compose build docker-compose + - docker-compose build xvfb + - docker-compose build installer + - docker-compose build test-runner install: - - docker-compose build ${INSTALLATION} - - docker-compose build ${INSTALLATION}-test - - docker-compose build ${INSTALLATION}-test-gui + - docker-compose build download-${INSTALLER_TYPE} + - docker-compose run installer ${INSTALLER_TYPE} ${INSTALLATION_TYPE} script: - - docker-compose run ${INSTALLATION} - - docker-compose run ${INSTALLATION}-test - - docker-compose run ${INSTALLATION}-test-gui + - docker-compose run test-runner racket-${INSTALLER_TYPE}-${INSTALLATION_TYPE} ${TEST_SUITE} diff --git a/Dockerfile.compose b/Dockerfile.compose new file mode 100644 index 0000000..dc10a10 --- /dev/null +++ b/Dockerfile.compose @@ -0,0 +1,4 @@ +FROM buildpack-deps:jessie + +RUN curl -L https://github.com/docker/compose/releases/download/1.17.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose +RUN chmod +x /usr/local/bin/docker-compose diff --git a/Dockerfile.download b/Dockerfile.download new file mode 100644 index 0000000..4e390c6 --- /dev/null +++ b/Dockerfile.download @@ -0,0 +1,15 @@ +FROM buildpack-deps:jessie-curl AS wget + +ARG RACKET_VERSION +ARG RACKET_INSTALLER_PLATFORM +ARG RACKET_INSTALLER_DIST +ARG RACKET_INSTALLER_HOST +ARG RACKET_INSTALLER_PATH_PREFIX + +ENV RACKET_INSTALLER_URL="https://${RACKET_INSTALLER_HOST}${RACKET_INSTALLER_PATH_PREFIX}/${RACKET_INSTALLER_DIST}-${RACKET_VERSION}-${RACKET_INSTALLER_PLATFORM}.sh" +RUN mkdir -p /usr/share/racket-download +RUN wget --quiet -O /usr/share/racket-download/installer ${RACKET_INSTALLER_URL} + +FROM scratch + +COPY --from=wget /usr/share/racket-download/installer /usr/share/racket-download/installer diff --git a/Dockerfile.installer b/Dockerfile.installer deleted file mode 100644 index aee2e02..0000000 --- a/Dockerfile.installer +++ /dev/null @@ -1,34 +0,0 @@ -# We use a three-image pipeline composed of an image to download the installer, -# an image to execute the installer, and an image containing the final -# extracted Racket installation. The buildpack-deps image repository is used by -# default because it's the official image used by all other official language -# runtime images (python, node, ruby, etc.). Following that convention -# cooperates very nicely with Docker's caching and means we get many useful OS -# packages by default. - -ARG RACKET_IMAGE_FOR_DOWNLOADER=buildpack-deps:jessie-curl -ARG RACKET_IMAGE_FOR_INSTALLER=buildpack-deps:jessie -ARG RACKET_IMAGE_FOR_RUNTIME=buildpack-deps:jessie - -FROM ${RACKET_IMAGE_FOR_DOWNLOADER} AS downloader - -ARG RACKET_VERSION -ARG RACKET_INSTALLER_PLATFORM -ARG RACKET_INSTALLER_DIST -ARG RACKET_INSTALLER_HOST -ARG RACKET_INSTALLER_PATH_PREFIX - -ENV RACKET_INSTALLER_URL="https://${RACKET_INSTALLER_HOST}${RACKET_INSTALLER_PATH_PREFIX}/${RACKET_INSTALLER_DIST}-${RACKET_VERSION}-${RACKET_INSTALLER_PLATFORM}.sh" -RUN wget --quiet -O "/tmp/racket-installer" "${RACKET_INSTALLER_URL}" - -FROM ${RACKET_IMAGE_FOR_INSTALLER} AS installer -COPY --from=downloader /tmp/racket-installer /tmp/racket-installer -RUN sh /tmp/racket-installer --in-place --create-dir --dest /usr/racket - -FROM ${RACKET_IMAGE_FOR_RUNTIME} -COPY --from=installer /usr/racket /usr/racket -ENV PATH="/usr/racket/bin:${PATH}" -ENV SSL_CERT_FILE="/usr/lib/ssl/cert.pem" -ENV SSL_CERT_DIR="/usr/lib/ssl/certs" -RUN raco setup -CMD ["racket"] diff --git a/docker-compose.yml b/docker-compose.yml index 37a28df..9214c0c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,18 +1,7 @@ version: "3.2" -# To build and test everything from scratch: "docker-compose up --build" -# But this runs all tests --- including the memory-hungry db tests --- in -# parallel, causing OOMEs and subsequent container death on typical laptops. - services: - # TODO: This configuration is highly repetitive and should be made more - # abstract. This is likely best achieved with a "test runner container" that - # bind mounts the docker socket and calls the docker REST API from a script - # to programmatically build and test each combination of installater options. - # Doing this in Python would be relatively easy, since there's already an - # official and supported docker client python library. - # TODO: From-source builds aren't included yet, but they're not difficult to # add. Neither are minimal-with-prebuilt-pkgs installations, unix-style # installations, or tests for installation uninstall scripts. Doing this @@ -69,43 +58,59 @@ services: - novnc - websockify - racket-x86: - image: racket-x86 + docker-compose: + image: docker-compose build: context: . + dockerfile: Dockerfile.compose + + installer: + build: + context: ./installer dockerfile: Dockerfile.installer + args: + DOCKER_COMPOSE_IMAGE: docker-compose + environment: + RACKET_BASE_IMAGE: ${RACKET_BASE_IMAGE:-buildpack-deps:jessie} + INSTALLER_PATH: /usr/share/racket-download/installer + volumes: + - /var/run/docker.sock:/var/run/docker.sock + + test-runner: + build: + context: ./test-runner + dockerfile: Dockerfile.test-runner + args: + DOCKER_COMPOSE_IMAGE: docker-compose + environment: + RACKET_TESTS_X11_DISPLAY: xvfb:0.0 + RACKET_TESTS_X11_NETWORK: "${COMPOSE_PROJECT_NAME}_default" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + depends_on: + - xvfb + + download-linux-64-ospkg-full: + image: download-linux-64-ospkg-full + build: + context: . + dockerfile: Dockerfile.download # We use a YAML anchor for the build args to set a common version, # installer website, and installer path for building all installation - # service images. See racket-x86-minimal.build.args for an example of how - # the anchor is used. + # service images. See download-linux-64-ospkg-minimal.build.args for an + # example of how the anchor is used. args: &default-build-args RACKET_VERSION: "${RACKET_VERSION}" RACKET_INSTALLER_HOST: "${RACKET_INSTALLER_HOST}" RACKET_INSTALLER_PATH_PREFIX: "${RACKET_INSTALLER_PATH_PREFIX}" RACKET_INSTALLER_PLATFORM: "${RACKET_PLATFORM_LINUX_64}" RACKET_INSTALLER_DIST: "${RACKET_DIST_FULL}" - command: racket -e '(+ 1 2)' - racket-x86-test: - image: racket-x86-test - build: - context: . - dockerfile: Dockerfile.test - args: - RACKET_IMAGE: racket-x86 - command: ["/bin/sh", "-c", "/usr/bin/racket-tests.sh"] - racket-x86-test-gui: &gui-test-service - image: racket-x86-test - environment: - DISPLAY: xvfb:0.0 - depends_on: - - xvfb - command: ["/bin/sh", "-c", "/usr/bin/racket-gui-tests.sh"] - racket-x86-minimal: - image: racket-x86-minimal + download-linux-64-ospkg-minimal: + image: download-linux-64-ospkg-minimal build: context: . - dockerfile: Dockerfile.installer + dockerfile: Dockerfile.download args: # We import the default build args and overwrite the desired platform # and distribution type. The platform defaults to x86_64 linux already @@ -116,116 +121,46 @@ services: <<: *default-build-args RACKET_INSTALLER_PLATFORM: "${RACKET_PLATFORM_LINUX_64}" RACKET_INSTALLER_DIST: "${RACKET_DIST_MINIMAL}" - command: racket -e '(+ 1 2)' - racket-x86-minimal-test: - image: racket-x86-minimal-test - build: - context: . - dockerfile: Dockerfile.test - args: - RACKET_IMAGE: racket-x86-minimal - command: ["/bin/sh", "-c", "/usr/bin/racket-tests.sh"] - racket-x86-minimal-test-gui: - <<: *gui-test-service - image: racket-x86-minimal-test - racket-i386: - image: racket-i386 + download-linux-32-ospkg-full: + image: download-linux-32-ospkg-full build: context: . - dockerfile: Dockerfile.installer + dockerfile: Dockerfile.download args: <<: *default-build-args - # Base images changed to i386 variants, as using the default images - # won't compile due to architecture assumptions. - RACKET_IMAGE_FOR_INSTALLER: i386/buildpack-deps - RACKET_IMAGE_FOR_RUNTIME: i386/buildpack-deps RACKET_INSTALLER_PLATFORM: "${RACKET_PLATFORM_LINUX_32}" RACKET_INSTALLER_DIST: "${RACKET_DIST_FULL}" - command: racket -e '(+ 1 2)' - racket-i386-test: - image: racket-i386-test - build: - context: . - dockerfile: Dockerfile.test - args: - RACKET_IMAGE: racket-i386 - command: ["/bin/sh", "-c", "/usr/bin/racket-tests.sh"] - racket-i386-test-gui: - <<: *gui-test-service - image: racket-i386-test - racket-i386-minimal: - image: racket-i386-minimal + download-linux-32-ospkg-minimal: + image: download-linux-32-ospkg-minimal build: context: . - dockerfile: Dockerfile.installer + dockerfile: Dockerfile.download args: <<: *default-build-args - RACKET_IMAGE_FOR_INSTALLER: i386/buildpack-deps - RACKET_IMAGE_FOR_RUNTIME: i386/buildpack-deps RACKET_INSTALLER_PLATFORM: "${RACKET_PLATFORM_LINUX_32}" RACKET_INSTALLER_DIST: "${RACKET_DIST_MINIMAL}" - command: racket -e '(+ 1 2)' - racket-i386-minimal-test: - image: racket-i386-minimal-test - build: - context: . - dockerfile: Dockerfile.test - args: - RACKET_IMAGE: racket-i386-minimal - command: ["/bin/sh", "-c", "/usr/bin/racket-tests.sh"] - racket-i386-minimal-test-gui: - <<: *gui-test-service - image: racket-i386-minimal-test - - # TODO: Figure out why natipkg builds are failing. Seems to be related to - # problems with the libssl and libcrypto (OpenSSL libs) libs included in the - # racket-x86_64-linux-natipkg-2 package. - racket-x86-natipkg: - image: racket-x86-natipkg + download-linux-64-natipkg-full: + image: download-linux-64-natipkg-full build: context: . - dockerfile: Dockerfile.installer + dockerfile: Dockerfile.download args: <<: *default-build-args RACKET_INSTALLER_PLATFORM: "${RACKET_PLATFORM_LINUX_NATIPKG_64}" RACKET_INSTALLER_DIST: "${RACKET_DIST_FULL}" - command: racket -e '(+ 1 2)' - racket-x86-natipkg-test: - image: racket-x86-natipkg-test - build: - context: . - dockerfile: Dockerfile.test - args: - RACKET_IMAGE: racket-x86-natipkg - command: ["/bin/sh", "-c", "/usr/bin/racket-tests.sh"] - racket-x86-natipkg-test-gui: - <<: *gui-test-service - image: racket-x86-natipkg-test - racket-x86-natipkg-minimal: - image: racket-x86-natipkg-minimal + download-linux-64-natipkg-minimal: + image: download-linux-64-natipkg-minimal build: context: . - dockerfile: Dockerfile.installer + dockerfile: Dockerfile.download args: <<: *default-build-args RACKET_INSTALLER_PLATFORM: "${RACKET_PLATFORM_LINUX_NATIPKG_64}" RACKET_INSTALLER_DIST: "${RACKET_DIST_MINIMAL}" - command: racket -e '(+ 1 2)' - racket-x86-natipkg-minimal-test: - image: racket-x86-natipkg-minimal-test - build: - context: . - dockerfile: Dockerfile.test - args: - RACKET_IMAGE: racket-x86-natipkg-minimal - command: ["/bin/sh", "-c", "/usr/bin/racket-tests.sh"] - racket-x86-natipkg-minimal-test-gui: - <<: *gui-test-service - image: racket-x86-natipkg-minimal-test volumes: nginx-html: diff --git a/environments/release.env b/environments/release.env index 949ac31..4cf6f1a 100644 --- a/environments/release.env +++ b/environments/release.env @@ -1,6 +1,7 @@ # Environment file that tells docker-compose to use release installers obtained # from the mirror.racket-lang.org site. +COMPOSE_PROJECT_NAME=racketrelease RACKET_INSTALLER_HOST=mirror.racket-lang.org RACKET_INSTALLER_PATH_PREFIX==/installers/${RACKET_VERSION} diff --git a/environments/snapshot.env b/environments/snapshot.env index 8881e53..886221c 100644 --- a/environments/snapshot.env +++ b/environments/snapshot.env @@ -2,6 +2,7 @@ # installer. The version still has to be specified, even though snapshots # besides the most recent one can't be installed. +COMPOSE_PROJECT_NAME=racketrelease RACKET_INSTALLER_HOST=www.cs.utah.edu RACKET_INSTALLER_PATH_PREFIX=/plt/snapshots/current/installers diff --git a/installer/Dockerfile.installer b/installer/Dockerfile.installer new file mode 100644 index 0000000..430d731 --- /dev/null +++ b/installer/Dockerfile.installer @@ -0,0 +1,11 @@ +ARG DOCKER_COMPOSE_IMAGE + +FROM ${DOCKER_COMPOSE_IMAGE} + +RUN mkdir /etc/racket-installer +COPY ./docker-compose.yml /etc/racket-installer/docker-compose.yml +COPY ./Dockerfile.script-inplace /etc/racket-installer/Dockerfile.script-inplace + +COPY ./installer.sh /usr/bin/racket-installer +RUN chmod +x /usr/bin/racket-installer +ENTRYPOINT ["racket-installer"] diff --git a/installer/Dockerfile.script-inplace b/installer/Dockerfile.script-inplace new file mode 100644 index 0000000..1ec0b23 --- /dev/null +++ b/installer/Dockerfile.script-inplace @@ -0,0 +1,21 @@ +ARG RACKET_BASE_IMAGE +ARG INSTALLER_IMAGE + +FROM ${INSTALLER_IMAGE} AS download + +FROM ${RACKET_BASE_IMAGE} AS installation +ARG INSTALLER_PATH + +COPY --from=download ${INSTALLER_PATH} /usr/share/racket-installer/installer.sh +RUN sh /usr/share/racket-installer/installer.sh --in-place --create-dir --dest /usr/racket + +FROM ${RACKET_BASE_IMAGE} + +RUN mkdir /home/racket +ENV RACKET_DIRS="/usr/racket /home/racket" +ENV SSL_CERT_FILE="/usr/lib/ssl/cert.pem" +ENV SSL_CERT_DIR="/usr/lib/ssl/certs" +COPY --from=installation /usr/racket /usr/racket +ENV PATH="/usr/racket/bin:${PATH}" +RUN raco setup +CMD ["racket"] diff --git a/installer/docker-compose.yml b/installer/docker-compose.yml new file mode 100644 index 0000000..de3bea1 --- /dev/null +++ b/installer/docker-compose.yml @@ -0,0 +1,12 @@ +version: "3.2" + +services: + script-inplace: + image: racket-${INSTALLER_TYPE}-script-inplace + build: + context: /etc/racket-installer + dockerfile: Dockerfile.script-inplace + args: + RACKET_BASE_IMAGE: ${RACKET_BASE_IMAGE} + INSTALLER_IMAGE: download-${INSTALLER_TYPE} + INSTALLER_PATH: ${INSTALLER_PATH} diff --git a/installer/installer.sh b/installer/installer.sh new file mode 100644 index 0000000..bc0c94a --- /dev/null +++ b/installer/installer.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -eufx + +INSTALLER_TYPE=$1 +INSTALLATION_TYPE=$2 + +export INSTALLATION_TYPE +export INSTALLER_TYPE + +alias installer-compose="docker-compose -f /etc/racket-installer/docker-compose.yml -p ${INSTALLER_TYPE}" + +installer-compose build --force-rm ${INSTALLATION_TYPE} +installer-compose run --rm ${INSTALLATION_TYPE} racket --version diff --git a/Dockerfile.test b/test-runner/Dockerfile.test similarity index 56% rename from Dockerfile.test rename to test-runner/Dockerfile.test index 8c1b523..f5cdf7a 100644 --- a/Dockerfile.test +++ b/test-runner/Dockerfile.test @@ -14,17 +14,15 @@ RUN raco pkg install --auto --installation --skip-installed \ raco-find-collection \ https://github.com/racket/pcps-test.git -RUN mkdir /home/racket \ - && groupadd -r racket \ +RUN groupadd -r racket \ && useradd --no-log-init -r -g racket racket \ - && chown -R racket:racket /home/racket \ - && chown -R racket:racket /usr/racket + && chown -R racket:racket ${RACKET_DIRS} -COPY ./test.sh /usr/bin/racket-tests.sh -COPY ./test-gui.sh /usr/bin/racket-gui-tests.sh -RUN chmod +x /usr/bin/racket-tests.sh -RUN chmod +x /usr/bin/racket-gui-tests.sh +COPY ./suite-failing.sh /usr/bin/suite-failing +COPY ./suite-gui.sh /usr/bin/suite-gui +COPY ./suite-nogui.sh /usr/bin/suite-nogui +RUN chmod +x /usr/bin/suite-failing +RUN chmod +x /usr/bin/suite-gui +RUN chmod +x /usr/bin/suite-nogui USER racket:racket - -CMD ["/bin/sh", "-c", "/usr/bin/racket-tests.sh"] diff --git a/test-runner/Dockerfile.test-runner b/test-runner/Dockerfile.test-runner new file mode 100644 index 0000000..4bd5f7c --- /dev/null +++ b/test-runner/Dockerfile.test-runner @@ -0,0 +1,14 @@ +ARG DOCKER_COMPOSE_IMAGE + +FROM ${DOCKER_COMPOSE_IMAGE} + +RUN mkdir /etc/racket-test-runner +COPY ./docker-compose.yml /etc/racket-test-runner/docker-compose.yml +COPY ./Dockerfile.test /etc/racket-test-runner/Dockerfile.test +COPY ./suite-failing.sh /etc/racket-test-runner/suite-failing.sh +COPY ./suite-gui.sh /etc/racket-test-runner/suite-gui.sh +COPY ./suite-nogui.sh /etc/racket-test-runner/suite-nogui.sh + +COPY ./test-runner.sh /usr/bin/racket-test-runner +RUN chmod +x /usr/bin/racket-test-runner +ENTRYPOINT ["racket-test-runner"] diff --git a/test-runner/docker-compose.yml b/test-runner/docker-compose.yml new file mode 100644 index 0000000..6ce0703 --- /dev/null +++ b/test-runner/docker-compose.yml @@ -0,0 +1,17 @@ +version: "3.2" + +services: + racket-tests: + image: ${RACKET_IMAGE}-tests + build: + context: /etc/racket-test-runner + dockerfile: Dockerfile.test + args: + RACKET_IMAGE: ${RACKET_IMAGE} + environment: + DISPLAY: ${RACKET_TESTS_X11_DISPLAY} + +networks: + default: + external: + name: ${RACKET_TESTS_X11_NETWORK} diff --git a/test-fail.sh b/test-runner/suite-failing.sh similarity index 98% rename from test-fail.sh rename to test-runner/suite-failing.sh index 08309bf..eb9a9dd 100644 --- a/test-fail.sh +++ b/test-runner/suite-failing.sh @@ -1,3 +1,6 @@ +#!/bin/sh +set -eufx + # This script contains test commands that are currently known to fail due to # configuration issues or known bugs. They should be moved into the appropriate # `test.sh` or `test-gui.sh` script once fixed. diff --git a/test-gui.sh b/test-runner/suite-gui.sh similarity index 98% rename from test-gui.sh rename to test-runner/suite-gui.sh index 664bd1c..9978187 100644 --- a/test-gui.sh +++ b/test-runner/suite-gui.sh @@ -1,10 +1,9 @@ +#!/bin/sh +set -eufx + # Like the `test.sh` script, but for GUI tests. These tests require a running X # server (run with xvfb for a fake X backend) and several GUI-related foreign # libraries. -set -eufx - -# samth -racket -l typed-racket-test -- --all # jay raco test -c tests/xml # needs gui libs for XML snips @@ -19,4 +18,7 @@ racket -l 2htdp/tests/test-image raco test -c framework/tests +# samth +racket -l typed-racket-test -- --all + raco test -p pcps-test diff --git a/test.sh b/test-runner/suite-nogui.sh similarity index 99% rename from test.sh rename to test-runner/suite-nogui.sh index be81119..f5bbba4 100644 --- a/test.sh +++ b/test-runner/suite-nogui.sh @@ -1,7 +1,9 @@ +#!/bin/sh +set -eufx + # See "Writing Safe Shell Scripts" at https://sipb.mit.edu/doc/safe-shell/ # Note that this script is run with "sh", not bash, so pipefail isn't a thing # We also set -x in order to see each test command in `docker-compose logs`. -set -eufx # TODO: Ideally, these test suites should all be run with `raco test`. This # enables proper counting of test cases and removes the need for separate diff --git a/test-runner/test-runner.sh b/test-runner/test-runner.sh new file mode 100644 index 0000000..b944135 --- /dev/null +++ b/test-runner/test-runner.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -eufx + +RACKET_IMAGE=$1 +RACKET_TEST_SUITE=$2 +export RACKET_IMAGE + +alias test-runner-compose="docker-compose -f /etc/racket-test-runner/docker-compose.yml -p ${RACKET_IMAGE}" + +test-runner-compose build --force-rm racket-tests +test-runner-compose run --rm racket-tests suite-${RACKET_TEST_SUITE}