This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Add CI for e2e #208
Merged
yizheliu-amazon
merged 3 commits into
opendistro-for-elasticsearch:master
from
yizheliu-amazon:e2e-ci
Jun 23, 2020
Merged
Add CI for e2e #208
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: E2E tests workflow | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
tests: | ||
name: Run e2e tests | ||
strategy: | ||
matrix: | ||
os: [ubuntu-16.04] # use ubuntu-16.04 as required by cypress: https://github.com/marketplace/actions/cypress-io#important | ||
java: [14] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Pull and Run Docker | ||
run: | | ||
version=1.8.0 | ||
echo $version | ||
if docker pull opendistroforelasticsearch/opendistroforelasticsearch:$version | ||
then | ||
echo "FROM opendistroforelasticsearch/opendistroforelasticsearch:$version" >> Dockerfile | ||
## The ESRestTest Client uses http by default. | ||
## Need to disable the security plugin to call the rest api over http. | ||
echo "RUN if [ -d /usr/share/elasticsearch/plugins/opendistro_security ]; then /usr/share/elasticsearch/bin/elasticsearch-plugin remove opendistro_security; fi" >> Dockerfile | ||
docker build -t odfe-ad:test . | ||
fi | ||
- name: Run Docker Image | ||
run: | | ||
docker run -p 9200:9200 -d -p 9600:9600 -e "discovery.type=single-node" odfe-ad:test | ||
sleep 90 | ||
curl -XGET http://localhost:9200/_cat/plugins | ||
|
||
- name: Checkout Kibana | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: elastic/kibana | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's hold for some time for response of using |
||
ref: v7.7.0 | ||
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 Anomaly Detection Kibana plugin | ||
uses: actions/checkout@v2 | ||
with: | ||
path: kibana/plugins/anomaly-detection-kibana-plugin | ||
- name: Attempt to bootstrap the plugin | ||
continue-on-error: true | ||
run: | | ||
cd kibana/plugins/anomaly-detection-kibana-plugin | ||
yarn kbn bootstrap | ||
- name: Bootstrap the plugin again | ||
ohltyler marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: | | ||
cd kibana/plugins/anomaly-detection-kibana-plugin | ||
yarn kbn bootstrap | ||
- name: Run e2e tests | ||
uses: cypress-io/github-action@v1 | ||
with: | ||
working-directory: kibana/plugins/anomaly-detection-kibana-plugin | ||
command: yarn test:e2e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the change, very helpful. The workflow looks good.
Is it possible to test with security plugin enabled? No need to answer or change this PR if no clear answer now. We can create issue and research later.
Asking this as start detector REST API will start AD job. We'd better test with security plugin enabled to know if AD job can run successfully, generate AD result and show the result correctly on Kibana.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. I created issue: #209