Skip to content

Commit

Permalink
Merge branch 'main' into chore/os-plugin-build
Browse files Browse the repository at this point in the history
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
  • Loading branch information
ashwin-pc committed Nov 29, 2023
2 parents 0bab763 + dadfefa commit 77088a8
Show file tree
Hide file tree
Showing 326 changed files with 4,869 additions and 16,457 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @ananzh @kavilla @seanneumann @AMoo-Miki @ashwin-pc @joshuarrrr @abbyhu2000 @zengyan-amazon @kristenTian @zhongnansu @manasvinibs @ZilongX @Flyingliuhub @BSFishy @curq
* @ananzh @kavilla @seanneumann @AMoo-Miki @ashwin-pc @joshuarrrr @abbyhu2000 @zengyan-amazon @kristenTian @zhongnansu @manasvinibs @ZilongX @Flyingliuhub @BSFishy @curq @bandinib-amzn
125 changes: 124 additions & 1 deletion .github/workflows/build_and_test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ jobs:
run: |
git config --global core.autocrlf false
- name: Configure pagefile size (Windows only)
if: matrix.os == 'windows-latest'
uses: al-cheb/configure-pagefile-action@v1.3
with:
minimum-size: 16GB
maximum-size: 64GB
disk-root: "C:"

- name: Checkout code
uses: actions/checkout@v3

Expand Down Expand Up @@ -146,6 +154,14 @@ jobs:
run: |
git config --global core.autocrlf false
- name: Configure pagefile size (Windows only)
if: matrix.os == 'windows-latest'
uses: al-cheb/configure-pagefile-action@v1.3
with:
minimum-size: 16GB
maximum-size: 64GB
disk-root: "C:"

- name: Checkout code
uses: actions/checkout@v3

Expand Down Expand Up @@ -212,6 +228,95 @@ jobs:
test/*/failure_debug/
test/*/screenshots/
plugin-functional-tests:
name: Run plugin functional tests on ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
name: Linux
- os: windows-latest
name: Windows
runs-on: ${{ matrix.os }}
steps:
- run: echo Running plugin functional tests

- name: Configure git's autocrlf (Windows only)
if: matrix.os == 'windows-latest'
run: |
git config --global core.autocrlf false
- name: Configure pagefile size (Windows only)
if: matrix.os == 'windows-latest'
uses: al-cheb/configure-pagefile-action@v1.3
with:
minimum-size: 16GB
maximum-size: 64GB
disk-root: "C:"

- name: Checkout code
uses: actions/checkout@v3

- name: Setup JDK (Windows only)
if: matrix.os == 'windows-latest'
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Setup Yarn
run: |
npm uninstall -g yarn
npm i -g yarn@1.22.10
yarn config set network-timeout 1000000 -g
- name: Configure Yarn Cache (Linux)
if: matrix.os != 'windows-latest'
run: echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV

- name: Initialize Yarn Cache
uses: actions/cache@v3
if: matrix.os != 'windows-latest'
with:
path: ${{ env.YARN_CACHE_LOCATION }}
key: yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-
- name: Setup chromedriver
run: node scripts/upgrade_chromedriver.js

- name: Run bootstrap (Linux)
if: matrix.os != 'windows-latest'
run: yarn osd bootstrap

- name: Run bootstrap (Windows)
if: matrix.os == 'windows-latest'
run: yarn osd bootstrap || yarn osd bootstrap

- name: Build plugins
run: node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 10 --scan-dir "./test/plugin_functional/plugins"

- name: Run functional plugin tests
id: plugin-ftr-tests
run: node scripts/functional_tests.js --config test/plugin_functional/config.ts

- uses: actions/upload-artifact@v3
if: failure()
with:
name: failure-artifacts-plugin-functional-${{ matrix.os }}
path: |
test/*/failure_debug/
test/*/screenshots/
build-min-artifact-tests:
name: Build min release artifacts on ${{ matrix.name }}
strategy:
Expand All @@ -227,6 +332,16 @@ jobs:
ext: tar.gz
suffix: linux-arm64
script: build-platform --linux-arm --skip-os-packages
- os: macos-latest
name: macOS x64
ext: tar.gz
suffix: darwin-x64
script: build-platform --darwin --skip-os-packages
- os: macos-latest
name: macOS ARM64
ext: tar.gz
suffix: darwin-arm64
script: build-platform --darwin-arm --skip-os-packages
- os: windows-latest
name: Windows x64
ext: zip
Expand All @@ -243,6 +358,14 @@ jobs:
git config --global core.autocrlf false
working-directory: .

- name: Configure pagefile size (Windows only)
if: matrix.os == 'windows-latest'
uses: al-cheb/configure-pagefile-action@v1.3
with:
minimum-size: 16GB
maximum-size: 64GB
disk-root: "C:"

- name: Checkout code
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -352,7 +475,7 @@ jobs:
id: verify-opensearch-exists
run: |
if curl -I -L ${{ env.OPENSEARCH_URL }}; then
echo "::set-output name=version-exists::true"
echo "name=version-exists::true" >> $GITHUB_OUTPUT
fi
- name: Skipping tests
Expand Down
47 changes: 32 additions & 15 deletions .github/workflows/cypress_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,29 @@ on:
workflow_dispatch:
inputs:
test_repo:
description: 'Test repo'
description: 'Cypress test repo'
default: 'opensearch-project/opensearch-dashboards-functional-test'
required: true
type: string
test_branch:
description: 'Test branch (default: source branch)'
description: 'Cypress test branch (default: source branch)'
required: false
type: string
pr_number:
description: 'PR Number'
required: false
type: number
specs:
description: 'Tests to run (default: core)'
default: 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js,'
description: 'Tests to run (default: osd:ciGroup)'
required: false
type: string
pr_number:
description: 'PR Number (optional)'
required: false
type: number

env:
TEST_REPO: ${{ inputs.test_repo != '' && inputs.test_repo || 'opensearch-project/opensearch-dashboards-functional-test' }}
TEST_BRANCH: "${{ inputs.test_branch != '' && inputs.test_branch || github.base_ref }}"
FTR_PATH: 'ftr'
START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch'
START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch --savedObjects.maxImportPayloadBytes=10485760 --server.maxPayloadBytes=1759977 --logging.json=false --data.search.aggs.shardDelay.enabled=true'
OPENSEARCH_SNAPSHOT_CMD: 'node ../scripts/opensearch snapshot -E cluster.routing.allocation.disk.threshold_enabled=false'
SPEC: ${{ inputs.specs != '' && inputs.specs || 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js,' }}
CYPRESS_BROWSER: 'chromium'
CYPRESS_VISBUILDER_ENABLED: true
CYPRESS_DATASOURCE_MANAGEMENT_ENABLED: false
Expand All @@ -46,6 +44,10 @@ env:
jobs:
cypress-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
group: [1, 2, 3, 4, 5, 6, 7, 8, 9]
container:
image: docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2
options: --user 1001
Expand All @@ -54,7 +56,7 @@ jobs:
CI: 1
# avoid warnings like "tput: No value for $TERM and no -T specified"
TERM: xterm
name: Run cypress tests
name: Run cypress tests (osd:ciGroup${{ matrix.group }})
steps:
- name: Get source information from PR number
if: ${{ github.event_name == 'workflow_dispatch' && inputs.pr_number != '' }}
Expand Down Expand Up @@ -97,7 +99,7 @@ jobs:
run: yarn osd bootstrap

- name: Build plugins
run: node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 10
run: node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 12

- name: Checkout
uses: actions/checkout@v2
Expand All @@ -106,10 +108,27 @@ jobs:
repository: ${{ env.TEST_REPO }}
ref: '${{ env.TEST_BRANCH }}'

- name: Setup spec files by input
if: ${{ inputs.specs != '' }}
run: |
echo "SPEC=${{ inputs.specs }}" >> $GITHUB_ENV
- name: Setup spec files
if: ${{ inputs.specs == '' }}
working-directory: ${{ env.FTR_PATH }}
shell: bash
run: |
IFS="," read -a SPEC_ARRAY <<< $(yarn --silent osd:ciGroup${{ matrix.group }})
FORMATTED_SPEC=''
for i in "${SPEC_ARRAY[@]}"; do
FORMATTED_SPEC+="cypress/integration/core-opensearch-dashboards/opensearch-dashboards/${i},"
done
echo "SPEC=${FORMATTED_SPEC}" >> $GITHUB_ENV
- name: Get Cypress version
id: cypress_version
run: |
echo "::set-output name=cypress_version::$(cat ./${{ env.FTR_PATH }}/package.json | jq '.devDependencies.cypress' | tr -d '"')"
echo "name=cypress_version::$(cat ./${{ env.FTR_PATH }}/package.json | jq '.devDependencies.cypress' | tr -d '"')" >> $GITHUB_OUTPUT
- name: Cache Cypress
id: cache-cypress
Expand Down Expand Up @@ -179,8 +198,6 @@ jobs:
#### Inputs:
```
Source repo: '${{ env.SOURCE_REPO }}'
Source branch: '${{ env.SOURCE_BRANCH }}'
Test repo: '${{ env.TEST_REPO }}'
Test branch: '${{ env.TEST_BRANCH }}'
Expand Down
Loading

0 comments on commit 77088a8

Please sign in to comment.