Skip to content

Bump 4.9.0 rev 06

Bump 4.9.0 rev 06 #318

name: Integration Tests
on: [push, pull_request]
env:
TEST_BROWSER_HEADLESS: 1
CI: 1
PLUGIN_NAME: opensearch-security
OPENSEARCH_INITIAL_ADMIN_PASSWORD: admin
jobs:
tests:
name: Run integration tests
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest] # Removed windows-latest
runs-on: ${{ matrix.os }}
env:
OPENSEARCH_INITIAL_ADMIN_PASSWORD: admin
steps:
- name: Checkout Branch
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: Set env
run: |
opensearch_version=$(node -p "require('./package.json').opensearchDashboards.version")
plugin_version=$(node -p "require('./package.json').version")
echo "OPENSEARCH_VERSION=$opensearch_version" >> $GITHUB_ENV
echo "PLUGIN_VERSION=$plugin_version" >> $GITHUB_ENV
shell: bash
- uses: browser-actions/[email protected]
- run: geckodriver --version
- name: Set up Firefox browser
if: ${{ runner.os == 'Linux' }}
uses: browser-actions/setup-firefox@v1
- run: firefox --version
if: ${{ runner.os == 'Linux' }}
# Browser-action version does not work on Windows
# - name: Set up Firefox browser for Windows
# if: ${{ runner.os == 'Windows' }}
# uses: RyanL1997/setup-browser@main
# with:
# browser: firefox
# version: latest
- name: Download security plugin and create setup scripts
uses: ./.github/actions/download-plugin
with:
opensearch-version: ${{ env.OPENSEARCH_VERSION }}
plugin-name: ${{ env.PLUGIN_NAME }}
plugin-version: ${{ env.PLUGIN_VERSION }}
- name: Run Opensearch with security
uses: derek-ho/start-opensearch@v2
with:
opensearch-version: ${{ env.OPENSEARCH_VERSION }}
plugins: 'file:$(pwd)/${{ env.PLUGIN_NAME }}.zip'
security-enabled: true
admin-password: ${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }}
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
- name: Remove unnecessary files Linux
if: ${{ runner.os == 'Linux' }}
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- id: install-dashboards
uses: derek-ho/setup-opensearch-dashboards@v1
with:
plugin_name: wazuh-security-dashboards-plugin
app_reference: ${{ vars.WZD_REF }}
- name: Start Dashboards in background
run: node scripts/build_opensearch_dashboards_platform_plugins.js
working-directory: ${{ steps.install-dashboards.outputs.dashboards-directory }}
- name: Yarn cache clean
run: yarn cache clean
- name: Run integration tests on Linux
if: ${{ runner.os == 'Linux' }}
run: |
echo "check if opensearch is ready"
curl -XGET https://localhost:9200 -u 'admin:${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }}' -k
yarn test:jest_server --coverage
working-directory: ${{ steps.install-dashboards.outputs.plugin-directory }}
# - name: Run integration tests on Windows
# if: ${{ runner.os == 'Windows' }}
# run: |
# echo "check if opensearch is ready"
# curl -XGET https://localhost:9200 -u 'admin:${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }}' -k
# node .\test\run_jest_tests.js --runInBand --detectOpenHandles --forceExit --config .\test\jest.config.server.js
# working-directory: ${{ steps.install-dashboards.outputs.plugin-directory }}