Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compile step before Cypress runs in CI #2187

Merged
merged 8 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,23 @@ jobs:
with:
path: OpenSearch-Dashboards/plugins/dashboards-observability

- name: Get yarn cache dir
id: setup-yarn
shell: bash
run: |
cd ./OpenSearch-Dashboards
source $NVM_DIR/nvm.sh
nvm use
echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Yarn Cache
uses: actions/cache@v4
with:
path: ${{ steps.setup-yarn.outputs.yarn-cache-dir }}
key: ${{ runner.OS }}-yarn-${{ hashFiles('OpenSearch-Dashboards/**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-

- name: Plugin Bootstrap
uses: nick-fields/retry@v2
with:
Expand Down Expand Up @@ -118,6 +135,20 @@ jobs:
- run: node -v
- run: yarn -v

- name: Get yarn cache dir
id: setup-yarn
shell: bash
run: |
echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Yarn Cache
uses: actions/cache@v4
with:
path: ${{ steps.setup-yarn.outputs.yarn-cache-dir }}
key: ${{ runner.OS }}-yarn-${{ hashFiles('OpenSearch-Dashboards/**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-

- name: Checkout Dashboards Observability
uses: actions/checkout@v2
with:
Expand Down
27 changes: 21 additions & 6 deletions .github/workflows/ftr-e2e-dashboards-observability-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,31 @@ jobs:
registry-url: "https://registry.npmjs.org"

- name: Install correct yarn version for OpenSearch Dashboards
id: setup-yarn
run: |
npm uninstall -g yarn
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}"
npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }}
echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Bootstrap the plugin
- name: Yarn Cache
uses: actions/cache@v4
with:
path: ${{ steps.setup-yarn.outputs.yarn-cache-dir }}
key: ${{ runner.OS }}-yarn-${{ hashFiles('OpenSearch-Dashboards/**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-

- name: Bootstrap OpenSearch Dashboards
run: |
cd OpenSearch-Dashboards/plugins/dashboards-observability
cd OpenSearch-Dashboards
yarn osd bootstrap --single-version=loose

- name: Compile OpenSearch Dashboards
run: |
cd OpenSearch-Dashboards
node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers=10 --verbose

- name: Run OpenSearch Dashboards server
run: |
cd OpenSearch-Dashboards
Expand All @@ -128,12 +143,12 @@ jobs:
if: ${{ runner.os == 'Linux' }}
run: |
cd ./OpenSearch-Dashboards
if timeout 600 grep -q "bundles compiled successfully after" <(tail -n0 -f dashboard.log); then
echo "OpenSearch Dashboards compiled successfully."
if timeout 60 grep -q "http server running" <(tail -n +1 -f dashboard.log); then
echo "OpenSearch Dashboards started successfully."
else
echo "Timeout for 600 seconds reached. OpenSearch Dashboards did not finish compiling."
echo "Timeout of 60 seconds reached. OpenSearch Dashboards did not start successfully."
exit 1
fi
fi&

- name: Checkout Dashboards Functioanl Test Repo
uses: actions/checkout@v2
Expand Down
27 changes: 21 additions & 6 deletions .github/workflows/integration-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,31 @@ jobs:
working-directory: OpenSearch-Dashboards

- name: Install correct yarn version for OpenSearch Dashboards
id: setup-yarn
run: |
npm uninstall -g yarn
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}"
npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }}
echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Bootstrap the plugin
- name: Yarn Cache
uses: actions/cache@v4
with:
path: ${{ steps.setup-yarn.outputs.yarn-cache-dir }}
key: ${{ runner.OS }}-yarn-${{ hashFiles('OpenSearch-Dashboards/**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-

- name: Bootstrap OpenSearch Dashboards
run: |
cd OpenSearch-Dashboards/plugins/dashboards-observability
cd OpenSearch-Dashboards
yarn osd bootstrap --single-version=loose

- name: Compile OpenSearch Dashboards
run: |
cd OpenSearch-Dashboards
node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers=10 --verbose

- name: Run OpenSearch Dashboards server
run: |
cd OpenSearch-Dashboards
Expand All @@ -150,12 +165,12 @@ jobs:
if: ${{ runner.os == 'Linux' }}
run: |
cd ./OpenSearch-Dashboards
if timeout 600 grep -q "bundles compiled successfully after" <(tail -n0 -f dashboard.log); then
echo "OpenSearch Dashboards compiled successfully."
if timeout 60 grep -q "http server running" <(tail -n +1 -f dashboard.log); then
echo "OpenSearch Dashboards started successfully."
else
echo "Timeout for 600 seconds reached. OpenSearch Dashboards did not finish compiling."
echo "Timeout of 60 seconds reached. OpenSearch Dashboards did not start successfully."
exit 1
fi
fi&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you put to background it will continue to next step even if http server running didn't appear in dashboard.log yet, right? and if 60 seconds passed, will exit 1 be able to abort the workflow if it has already moved to the next step?


- name: Install Cypress
run: |
Expand Down
Loading