From 9f85616072e4ba5216a753cb39b72891577407aa Mon Sep 17 00:00:00 2001 From: "john.mcdonnell" Date: Mon, 10 Oct 2022 11:07:58 +0900 Subject: Adding test:macos to run E2E on a Mac runner --- .gitlab-ci.yml | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 30485d951..b91b6e64b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -109,7 +109,7 @@ include: # directory. - setpriv --reuid=${TEST_UID} --regid=${TEST_UID} --clear-groups --no-new-privs make ${TEST_TARGET} UNPRIVILEGED_CI_SKIP=YesPlease $(test "${GIT_VERSION}" = default && echo WITH_BUNDLED_GIT=YesPlease) - after_script: + after_script: &test_after_script - | # Checking for panics in ${TEST_FULL_OUTPUT} if [ "${CI_JOB_STATUS}" = "failed" ] && grep 'Output":"panic' "${TEST_FULL_OUTPUT}" > /dev/null; then @@ -411,3 +411,41 @@ qa:nightly-praefect-migration-test: project: gitlab-org/quality/praefect-migration-testing rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' + +test:macos: + stage: test + image: macos-12-xcode-13 + script: + - sw_vers + - ulimit -n 4096 # defaults with 256 which can lead to 'too many open files' errors + - pg_ctl -D /usr/local/var/postgres start > /tmp/postgres.log + - pg_ctl status + - createdb -U $PGUSER $POSTGRES_DB + # From `brew info coreutils` + # Commands also provided by macOS and the commands dir, dircolors, vdir have been installed with the prefix "g". + # If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH + - PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" + - brew install cmake coreutils + - sudo install --directory --owner=${TEST_UID} --group=${TEST_UID} _unprivileged + - *test_before_script + - make test-go + - *test_after_script + tags: + - shared-macos-amd64 + rules: + - if: $CI_PIPELINE_SOURCE == "schedule" + allow_failure: true + - when: manual + allow_failure: true + variables: + <<: *test_variables + PGDATA: /usr/local/var/postgres + PGHOST: localhost + PGUSER: gitlab + TEST_OPTIONS: "-timeout=20m" # a number of tests may exceed the default 10m + TEST_REPORT: /Users/gitlab/go-tests-report.xml # needs to be written to a dir which we have access to + artifacts: + reports: + junit: ${TEST_REPORT} + when: always + expire_in: 1 week -- cgit v1.2.3