diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9f9f394b..831aba37 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -58,12 +58,13 @@ jobs: runs-on: ubuntu-latest services: search-server: - image: opensearchproject/opensearch:2.6.0 + image: opensearchproject/opensearch:2.13.0 ports: - 9200:9200 env: discovery.type: single-node - plugins.security.disabled: 'true' + plugins.security.disabled: true + OPENSEARCH_INITIAL_ADMIN_PASSWORD: myStrongPassword123! steps: - name: Checkout @@ -130,8 +131,8 @@ jobs: run: | composer run unit - integration-test: - name: Tntegration Test + integration-test-elasticsearch: + name: Tntegration Test (Elasticsearch) runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -140,6 +141,48 @@ jobs: - ubuntu-latest search-server-image: - docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.0 + services: + search-server: + image: ${{ matrix.search-server-image }} + ports: + - 9200:9200 + env: + discovery.type: single-node + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Use PHP 8.2 + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + extensions: yaml, zip, curl + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Install dependencies + run: | + composer install --prefer-dist + + - name: Wait for Search server + run: php ./.github/wait_for_opensearch.php + + - name: Integration tests + run: | + composer run integration + env: + OPENSEARCH_URL: 'http://localhost:9200' + + integration-test-opensearch: + name: Tntegration Test (OpenSearch) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + search-server-image: - opensearchproject/opensearch:1.1.0 - opensearchproject/opensearch:1.2.4 - opensearchproject/opensearch:1.3.15 @@ -156,6 +199,49 @@ jobs: - opensearchproject/opensearch:2.9.0 - opensearchproject/opensearch:2.10.0 - opensearchproject/opensearch:2.11.1 + services: + search-server: + image: ${{ matrix.search-server-image }} + ports: + - 9200:9200 + env: + discovery.type: single-node + plugins.security.disabled: true + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Use PHP 8.2 + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + extensions: yaml, zip, curl + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Install dependencies + run: | + composer install --prefer-dist + + - name: Wait for Search server + run: php ./.github/wait_for_opensearch.php + + - name: Integration tests + run: | + composer run integration + env: + OPENSEARCH_URL: 'http://localhost:9200' + + integration-test-opensearch-strong-password: + name: Tntegration Test (OpenSearch w/Strong Password) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + search-server-image: - opensearchproject/opensearch:2.12.0 - opensearchproject/opensearch:2.13.0 services: @@ -165,7 +251,8 @@ jobs: - 9200:9200 env: discovery.type: single-node - plugins.security.disabled: '${{ contains(matrix.search-server-image, ''opensearch'') && ''true'' || '''' }}' + plugins.security.disabled: true + OPENSEARCH_INITIAL_ADMIN_PASSWORD: myStrongPassword123! steps: - name: Checkout diff --git a/tests/Utility.php b/tests/Utility.php index 5297eadc..78a44007 100644 --- a/tests/Utility.php +++ b/tests/Utility.php @@ -42,7 +42,10 @@ public static function getHost(): ?string if (false !== $url) { return $url; } - return 'https://admin:admin@localhost:9200'; + + $password = getenv('OPENSEARCH_INITIAL_ADMIN_PASSWORD') ?: 'admin'; + + return 'https://admin:' . $password . '@localhost:9200'; } /**