From 385854fe23efd5a873270c3992437f1dde47f81e Mon Sep 17 00:00:00 2001 From: Drew Baugher <46505179+dbbaughe@users.noreply.github.com> Date: Mon, 30 Mar 2020 22:03:53 -0700 Subject: [PATCH] Adds test workflow and updates snapshot (#121) --- .github/workflows/unit-tests-workflow.yml | 45 +++++++++++++++++++ .../__snapshots__/TriggerQuery.test.js.snap | 1 + 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/unit-tests-workflow.yml diff --git a/.github/workflows/unit-tests-workflow.yml b/.github/workflows/unit-tests-workflow.yml new file mode 100644 index 00000000..ae208615 --- /dev/null +++ b/.github/workflows/unit-tests-workflow.yml @@ -0,0 +1,45 @@ +name: Unit tests workflow +on: + pull_request: + branches: + - master + +jobs: + tests: + name: Run unit tests + runs-on: ubuntu-latest + steps: + - name: Checkout Kibana + uses: actions/checkout@v2 + with: + repository: opendistro-for-elasticsearch/kibana-oss + ref: 7.6.1 + token: ${{ secrets.GITHUB_KIBANA_OSS }} + path: kibana + - name: Get node and yarn versions + id: versions_step + run: | + echo "::set-output name=node_version::$(node -p "(require('./kibana/package.json').engines.node).match(/[.0-9]+/)[0]")" + echo "::set-output name=yarn_version::$(node -p "(require('./kibana/package.json').engines.yarn).match(/[.0-9]+/)[0]")" + - name: Setup node + uses: actions/setup-node@v1 + with: + node-version: ${{ steps.versions_step.outputs.node_version }} + registry-url: 'https://registry.npmjs.org' + - name: Install correct yarn version for Kibana + run: | + npm uninstall -g yarn + echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}" + npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }} + - name: Checkout Alerting Kibana plugin + uses: actions/checkout@v2 + with: + path: kibana/plugins/alerting-kibana-plugin + - name: Bootstrap plugin/kibana + run: | + cd kibana/plugins/alerting-kibana-plugin + yarn kbn bootstrap + - name: Run tests + run: | + cd kibana/plugins/alerting-kibana-plugin + yarn run test:jest diff --git a/public/pages/CreateTrigger/components/TriggerQuery/__snapshots__/TriggerQuery.test.js.snap b/public/pages/CreateTrigger/components/TriggerQuery/__snapshots__/TriggerQuery.test.js.snap index 5d5b09c9..c2354a00 100644 --- a/public/pages/CreateTrigger/components/TriggerQuery/__snapshots__/TriggerQuery.test.js.snap +++ b/public/pages/CreateTrigger/components/TriggerQuery/__snapshots__/TriggerQuery.test.js.snap @@ -52,6 +52,7 @@ exports[`TriggerQuery renders 1`] = ` >