From a9c8b2435f9a98cdda5dad1da0c776bbcbfe34a8 Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Tue, 23 Apr 2024 14:40:15 -0700 Subject: [PATCH] Revert "Temporarily disable most macos test (#80)" (#81) This reverts commit 33f24c316f5eb6d94b4d359c41b0d4d2dfcc4304. --- integration/macos/test.sh | 61 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/integration/macos/test.sh b/integration/macos/test.sh index a9bf588e..22aca378 100755 --- a/integration/macos/test.sh +++ b/integration/macos/test.sh @@ -1 +1,62 @@ #!/bin/bash + +set -eEx + +dest="artifacts" +if [ -n "${PKG_PLATFORM}" ]; then + dest="${dest}/${PKG_PLATFORM}" +fi +if [ -n "${PKG_PLATFORM_VERSION}" ]; then + dest="${dest}-${PKG_PLATFORM_VERSION}" +fi +if [ -n "${PKG_TEST_JOBS}" ]; then + dash_j="-j${PKG_TEST_JOBS}" +else + dash_j="" +fi + +cliurl="https://packages.edgedb.com/dist/${PKG_PLATFORM_VERSION}-apple-darwin.nightly" + +tarball= +for pack in ${dest}/*.tar; do + if [ -e "${pack}" ]; then + tarball=$(tar -xOf "${pack}" "build-metadata.json" \ + | jq -r ".installrefs[]" \ + | grep ".tar.gz$") + if [ -n "${tarball}" ]; then + break + fi + fi +done + +if [ -z "${tarball}" ]; then + echo "${dest} does not contain a valid build tarball" >&2 + exit 1 +fi + +workdir=$(mktemp -d) + +function finally { + rm -rf "$workdir" +} +trap finally EXIT ERR + +mkdir "${workdir}/bin" +curl --proto '=https' --tlsv1.2 -sSfL -o "${workdir}/bin/edgedb" \ + "${cliurl}/edgedb-cli" +chmod +x "${workdir}/bin/edgedb" + +gtar -xOf "${pack}" "${tarball}" | gtar -xzf- --strip-components=1 -C "$workdir" + +if [ "$1" == "bash" ]; then + cd "$workdir" + exec /bin/bash +fi + +export PATH="${workdir}/bin/:${PATH}" + +"${workdir}/bin/python3" \ + -m edb.tools --no-devmode test \ + "${workdir}/data/tests" \ + -e cqa_ -e tools_ \ + --verbose ${dash_j}