diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5890960..700a860 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,66 +1,70 @@ name: Test on: # Run CI on all pushes to the master and release/** branches, and on all new # pull requests, and on all pushes to pull requests (even if a pull request # is not against master). push: branches: - "master" - "release/**" pull_request: defaults: run: shell: bash jobs: unit-test: runs-on: ubuntu-20.04 name: "unit tests" steps: - name: Checkout uses: actions/checkout@v2 - name: Unit Tests working-directory: install run: find ./ -type f -name "*-test.sh" -exec "./{}" \; integration-test: runs-on: ubuntu-20.04 name: "integration test" strategy: fail-fast: false matrix: include: - compose_version: '1.28.0' compose_path: '/usr/local/bin' + - compose_version: '1.29.2' + compose_path: '/usr/local/bin' - compose_version: 'v2.0.1' compose_path: '/usr/local/lib/docker/cli-plugins' + - compose_version: 'v2.2.3' + compose_path: '/usr/local/lib/docker/cli-plugins' steps: - name: Checkout uses: actions/checkout@v2 - name: Get Compose run: | # Always remove `docker compose` support as that's the newer version # and comes installed by default nowadays. sudo rm -f "/usr/local/lib/docker/cli-plugins/docker-compose" sudo rm -f "${{ matrix.compose_path }}/docker-compose" sudo mkdir -p "${{ matrix.compose_path }}" sudo curl -L https://github.com/docker/compose/releases/download/${{ matrix.compose_version }}/docker-compose-`uname -s`-`uname -m` -o "${{ matrix.compose_path }}/docker-compose" sudo chmod +x "${{ matrix.compose_path }}/docker-compose" - name: Integration Test run: | echo "Testing initial install" ./install.sh ./_integration-test/run.sh echo "Testing in-place upgrade" # Also test plugin installation here echo "sentry-auth-oidc" >> sentry/requirements.txt ./install.sh --minimize-downtime ./_integration-test/run.sh - name: Inspect failure if: failure() run: | docker compose ps docker compose logs diff --git a/install/create-kafka-topics.sh b/install/create-kafka-topics.sh index a542cb5..3ea0ce5 100644 --- a/install/create-kafka-topics.sh +++ b/install/create-kafka-topics.sh @@ -1,14 +1,14 @@ echo "${_group}Creating additional Kafka topics ..." # NOTE: This step relies on `kafka` being available from the previous `snuba-api bootstrap` step # XXX(BYK): We cannot use auto.create.topics as Confluence and Apache hates it now (and makes it very hard to enable) -EXISTING_KAFKA_TOPICS=$($dcr kafka kafka-topics --list --bootstrap-server kafka:9092 2>/dev/null) +EXISTING_KAFKA_TOPICS=$($dcr --no-TTY kafka kafka-topics --list --bootstrap-server kafka:9092 2>/dev/null) NEEDED_KAFKA_TOPICS="ingest-attachments ingest-transactions ingest-events" for topic in $NEEDED_KAFKA_TOPICS; do if ! echo "$EXISTING_KAFKA_TOPICS" | grep -wq $topic; then $dcr kafka kafka-topics --create --topic $topic --bootstrap-server kafka:9092 echo "" fi done echo "${_endgroup}" diff --git a/install/relay-credentials.sh b/install/relay-credentials.sh index 2d62e2b..392e703 100644 --- a/install/relay-credentials.sh +++ b/install/relay-credentials.sh @@ -1,25 +1,25 @@ echo "${_group}Generating Relay credentials ..." RELAY_CONFIG_YML="../relay/config.yml" RELAY_CREDENTIALS_JSON="../relay/credentials.json" ensure_file_from_example $RELAY_CONFIG_YML if [[ ! -f "$RELAY_CREDENTIALS_JSON" ]]; then # We need the ugly hack below as `relay generate credentials` tries to read # the config and the credentials even with the `--stdout` and `--overwrite` # flags and then errors out when the credentials file exists but not valid # JSON. We hit this case as we redirect output to the same config folder, # creating an empty credentials file before relay runs. $dcr \ - --no-deps \ + --no-deps --no-TTY \ --volume "$(pwd)/$RELAY_CONFIG_YML:/tmp/config.yml" \ relay --config /tmp credentials generate --stdout \ > "$RELAY_CREDENTIALS_JSON" echo "Relay credentials written to $RELAY_CREDENTIALS_JSON" fi echo "${_endgroup}"