From 461040fda49234e75eef7c686a276a62fad0457f Mon Sep 17 00:00:00 2001 From: Leo Park Date: Tue, 3 Dec 2024 12:07:32 +0000 Subject: [PATCH] CI: Opensearch Test added referenced: https://opensearch.org/docs/latest/install-and-configure/install-opensearch/docker/ --- .../{tests.yml => elasticsearch_tests.yml} | 3 +- .github/workflows/opensearch_tests.yml | 41 +++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) rename .github/workflows/{tests.yml => elasticsearch_tests.yml} (97%) create mode 100644 .github/workflows/opensearch_tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/elasticsearch_tests.yml similarity index 97% rename from .github/workflows/tests.yml rename to .github/workflows/elasticsearch_tests.yml index 38604a0..f42a702 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/elasticsearch_tests.yml @@ -7,7 +7,7 @@ on: pull_request: jobs: - tests: + elasticsearch_tests: runs-on: ubuntu-latest services: es: @@ -39,4 +39,3 @@ jobs: - name: Run tests run: python3 search_test.py --count=2000 --search_db_url=http://localhost:9200 - diff --git a/.github/workflows/opensearch_tests.yml b/.github/workflows/opensearch_tests.yml new file mode 100644 index 0000000..cfd7112 --- /dev/null +++ b/.github/workflows/opensearch_tests.yml @@ -0,0 +1,41 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + +jobs: + opensearch_tests: + runs-on: ubuntu-latest + services: + es: + image: opensearchproject/opensearch:2 + ports: + - 9200:9200 + options: >- + --env discovery.type=single-node + --env "DISABLE_SECURITY_PLUGIN=true" + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + + - name: Install dependencies + run: | + pip install --upgrade pip + pip install -r requirements.txt + + - name: Wait for Elasticsearch + run: | + sleep 10 + curl -s http://localhost:9200 + + - name: Run tests + run: python3 search_test.py --count=2000 --search_db_url=http://localhost:9200