opendistro-for-elasticsearch / opendistro-build

🧰 Open Distro Build Scripts
https://opendistro.github.io/
Apache License 2.0
345 stars 176 forks source link

Insights Tests w Security Hooked with Infra #712

Open davidcui1225 opened 3 years ago

davidcui1225 commented 3 years ago

Added security support to:

davidcui1225 commented 3 years ago

For kibana-reports, we need to add the sample data after Kibana is running and bootstrapped, but before any of the cypress tests begin.

Kibana Reports

  1. Bootstrap plugin, start ES and Kibana
  2. Import Kibana sample data
curl -XPOST 'http://localhost:5601/api/sample_data/flights' -H 'kbn-xsrf: true' -H 'Content-Type: application/json'

curl -XPOST 'http://localhost:5601/api/sample_data/ecommerce' -H 'kbn-xsrf: true' -H 'Content-Type: application/json'

curl -XPOST 'http://localhost:5601/api/sample_data/logs' -H 'kbn-xsrf: true' -H 'Content-Type: application/json'
  1. Run cypress
    cd kibana/plugins/kibana-reports
    yarn cypress:run

Gantt Chart

  1. Bootstrap plugin, start ES and Kibana
  2. Run commands to import test data and create index pattern
    curl https://raw.githubusercontent.com/opendistro-for-elasticsearch/kibana-visualizations/main/gantt-chart/.cypress/utils/jaeger-sample.json | curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/jaeger/_bulk?pretty' --data-binary @- 
    curl -X POST "localhost:5601/api/saved_objects/index-pattern/jaeger"  -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' { "attributes": { "title": "jaeger" } } '
  3. Run cypress
    cd kibana/plugins/gantt-chart
    npx cypress run

Kibana Notebooks

Same as Gantt charts but skip step 2

davidcui1225 commented 3 years ago

Security is enabled depending on the security_enabled flag in cypress.json

gaiksaya commented 3 years ago

Hey @davidcui-amzn ,

does the mean the above cypress command should be npx cypress run --env security_enabled=true Please confirm and update the above command. Thanks!