From e2df055484af886ed0d9d6dc19fbd88ef07d83e4 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 5 Dec 2022 18:20:02 -0800 Subject: [PATCH] [1.3] Add windows os for unit tests (#435) (#436) * added windows os support Signed-off-by: Amardeepsingh Siglani * updated workflow Signed-off-by: Amardeepsingh Siglani * use bash shell for running commands Signed-off-by: Amardeepsingh Siglani * fixed yaml Signed-off-by: Amardeepsingh Siglani * modified test command Signed-off-by: Amardeepsingh Siglani * fixed test issues Signed-off-by: Amardeepsingh Siglani Signed-off-by: Amardeepsingh Siglani (cherry picked from commit ed48832d8865a411c8e109b7016a1cb30422bf9c) Co-authored-by: Amardeepsingh Siglani --- .github/workflows/unit-tests-workflow.yml | 18 +++++++++++++----- package.json | 2 +- .../TransformIndices/TransformIndices.tsx | 3 +-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/unit-tests-workflow.yml b/.github/workflows/unit-tests-workflow.yml index 651b707ef..8fb6f4a41 100644 --- a/.github/workflows/unit-tests-workflow.yml +++ b/.github/workflows/unit-tests-workflow.yml @@ -2,19 +2,24 @@ name: Unit tests workflow on: pull_request: branches: - - main - - 1.* + - "*" push: branches: - - main - - development-* + - "*" env: OPENSEARCH_DASHBOARDS_VERSION: '1.x' jobs: tests: name: Run unit tests - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest , windows-latest ] + runs-on: ${{ matrix.os }} steps: + - name: Enable longer filenames + if: ${{ matrix.os == 'windows-latest' }} + run: git config --system core.longpaths true - name: Checkout Index Management Dashboards plugin uses: actions/checkout@v2 with: @@ -30,6 +35,7 @@ jobs: run: | echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")" echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")" + shell: bash - name: Setup node uses: actions/setup-node@v1 with: @@ -40,12 +46,14 @@ jobs: npm uninstall -g yarn echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}" npm i -g yarn@${{ steps.versions.outputs.yarn_version }} + shell: bash - name: Bootstrap plugin/OpenSearch-Dashboards run: | mkdir -p OpenSearch-Dashboards/plugins mv index-management-dashboards-plugin OpenSearch-Dashboards/plugins cd OpenSearch-Dashboards/plugins/index-management-dashboards-plugin yarn osd bootstrap + shell: bash - name: Run tests run: | cd OpenSearch-Dashboards/plugins/index-management-dashboards-plugin diff --git a/package.json b/package.json index cb4366042..a93630edf 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "opensearch": "node ../../scripts/opensearch", "lint": "eslint .", "plugin-helpers": "node ../../scripts/plugin_helpers", - "test:jest": "NODE_PATH=../../node_modules ../../node_modules/.bin/jest --config ./test/jest.config.js", + "test:jest": "../../node_modules/.bin/jest --config ./test/jest.config.js", "build": "yarn plugin-helpers build", "postbuild": "echo Renaming build artifact to [$npm_package_config_zip_name-$npm_package_version.zip] && mv build/$npm_package_config_id*.zip build/$npm_package_config_zip_name-$npm_package_version.zip" }, diff --git a/public/pages/CreateTransform/components/TransformIndices/TransformIndices.tsx b/public/pages/CreateTransform/components/TransformIndices/TransformIndices.tsx index 15038c326..8986d2c19 100644 --- a/public/pages/CreateTransform/components/TransformIndices/TransformIndices.tsx +++ b/public/pages/CreateTransform/components/TransformIndices/TransformIndices.tsx @@ -164,8 +164,7 @@ export default class TransformIndices extends Component