Skip to content

Commit

Permalink
[1.3] Add windows os for unit tests (#435)
Browse files Browse the repository at this point in the history
* added windows os support

Signed-off-by: Amardeepsingh Siglani <[email protected]>

* updated workflow

Signed-off-by: Amardeepsingh Siglani <[email protected]>

* use bash shell for running commands

Signed-off-by: Amardeepsingh Siglani <[email protected]>

* fixed yaml

Signed-off-by: Amardeepsingh Siglani <[email protected]>

* modified test command

Signed-off-by: Amardeepsingh Siglani <[email protected]>

* fixed test issues

Signed-off-by: Amardeepsingh Siglani <[email protected]>

Signed-off-by: Amardeepsingh Siglani <[email protected]>
  • Loading branch information
amsiglan authored Dec 5, 2022
1 parent 51440dd commit ed48832
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/unit-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@ name: Unit tests workflow
on:
pull_request:
branches:
- main
- 1.*
- "*"
push:
branches:
- main
- development-*
- "*"
env:
OPENSEARCH_DASHBOARDS_VERSION: '1.3'
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:
Expand All @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ export default class TransformIndices extends Component<TransformIndicesProps, T
label="Source index"
error={sourceIndexError}
isInvalid={sourceIndexError != ""}
helpText="The index where this transform job is performed on. Type in * as wildcard for index pattern.
Indices cannot be changed once the job is created. Please ensure that you select the right source index."
helpText="The index where this transform job is performed on. Type in * as wildcard for index pattern. Indices cannot be changed once the job is created. Please ensure that you select the right source index."
>
<EuiComboBox
placeholder="Select source index"
Expand Down

0 comments on commit ed48832

Please sign in to comment.