Skip to content

Commit

Permalink
add mongoDB configuration for antithesis testing (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
agavra authored Sep 5, 2024
1 parent 77020a3 commit 0a13a4e
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/github-e2e-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ name: Antithesis Manual Run
on:
workflow_dispatch:
inputs:
backend:
description: 'The backend storage type to use'
type: choice
required: true
default: 'scylla'
options:
- scylla
- mongo
test-duration:
description: 'The duration that the antithesis test runs'
type: string
Expand All @@ -14,5 +22,6 @@ jobs:
contents: write # This is required for actions/checkout (read) and publishing tags (write)
uses: ./.github/workflows/github-e2e.yaml
with:
backend: ${{ inputs.backend }}
test-duration: ${{ inputs.test-duration }}
secrets: inherit
9 changes: 7 additions & 2 deletions .github/workflows/github-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Antithesis Test Run
on:
workflow_call:
inputs:
backend:
description: 'The backend storage type to use'
type: string
required: true
default: 'scylla'
test-duration:
description: 'The duration that the antithesis test runs'
type: string
Expand Down Expand Up @@ -69,7 +74,7 @@ jobs:
working-directory: ./kafka-client-examples/e2e-test/docker/antithesis
env:
KAFKA_CLIENT_VERSION: latest
BACKEND: scylla
BACKEND: ${{ inputs.backend }}
CONFIG_IMG_VERSION: ${{ steps.kafka_client_version.outputs.KAFKA_CLIENT_VERSION }}
run: |
cat config/docker-compose.yml.template | envsubst > config/docker-compose.yml
Expand All @@ -91,7 +96,7 @@ jobs:
password: ${{ secrets.ANTITHESIS_PASSWORD }}
github_token: ${{ secrets.ANTITHESIS_GH_PAT }}
config_image: us-central1-docker.pkg.dev/molten-verve-216720/responsive-repository/e2e-test-config:${{ steps.kafka_client_version.outputs.KAFKA_CLIENT_VERSION }}
images: us-central1-docker.pkg.dev/molten-verve-216720/responsive-repository/e2e-test:${{ steps.kafka_client_version.outputs.KAFKA_CLIENT_VERSION }}
images: us-central1-docker.pkg.dev/molten-verve-216720/responsive-repository/e2e-test:${{ steps.kafka_client_version.outputs.KAFKA_CLIENT_VERSION }};docker.io/mongo:5.0
description: "responsive antithesis test run"
email_recipients: "antithesis-responsive-aaaamurlsqy6e3hxnx6ksnec5y@antithesisgroup.slack.com"
additional_parameters: |-
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: '3'
include:
- ./docker-compose-base.yml
services:
mongo:
image: docker.io/mongo:5.0
container_name: mongo
hostname: mongo
command: mongod --replSet rs0
ports:
- "27017:27017"
volumes:
- ./volumes/mongo/data:/data/db
healthcheck:
test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'mongo:27017',priority:1},{_id:1,host:'mongo2:27017',priority:0.5},{_id:2,host:'mongo3:27017',priority:0.5}]}) }" | mongosh --port 27017 --quiet
interval: 5s
timeout: 30s
retries: 30
networks:
backend:
ipv4_address: 10.0.0.30

mongo2:
image: docker.io/mongo:5.0
container_name: mongo2
hostname: mongo2
command: mongod --replSet rs0
ports:
- "27018:27017"
volumes:
- ./volumes/mongo2/data:/data/db
networks:
backend:
ipv4_address: 10.0.0.31

mongo3:
image: docker.io/mongo:5.0
container_name: mongo3
hostname: mongo3
command: mongod --replSet rs0
ports:
- "27019:27017"
volumes:
- ./volumes/mongo3/data:/data/db
networks:
backend:
ipv4_address: 10.0.0.32
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Copyright 2023 Responsive Computing, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

bootstrap.servers=broker:9092
responsive.org=responsive
responsive.env=test

responsive.storage.backend.type=MONGO_DB
responsive.mongo.endpoint=mongodb://mongo:27017
Empty file.
Empty file.
Empty file.

0 comments on commit 0a13a4e

Please sign in to comment.