forked from opensearch-project/security-dashboards-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Saved Object Aggregation View (opensearch-project#1146)
* Saved Object Aggregation View (opensearch-project#1142) Signed-off-by: Chang Liu <[email protected]> Signed-off-by: Ryan Liang <[email protected]> Signed-off-by: Craig Perkins <[email protected]> Signed-off-by: Yan Zeng <[email protected]> Co-authored-by: Ryan Liang <[email protected]> Co-authored-by: Ryan Liang <[email protected]> Co-authored-by: Craig Perkins <[email protected]> Co-authored-by: Yan Zeng <[email protected]>
- Loading branch information
1 parent
7b80f9b
commit 7c8ede6
Showing
19 changed files
with
553 additions
and
41 deletions.
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,131 @@ | ||
name: Cypress Tests | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
TEST_BROWSER_HEADLESS: 1 | ||
CI: 1 | ||
FTR_PATH: 'ftr' | ||
START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch --opensearch_security.multitenancy.enable_aggregation_view=true' | ||
OPENSEARCH_SNAPSHOT_CMD: 'node ../scripts/opensearch snapshot' | ||
SPEC: 'cypress/integration/plugins/security-dashboards-plugin/aggregation_view.js,' | ||
|
||
jobs: | ||
tests: | ||
name: Run aggregation view cypress test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download OpenSearch Core | ||
run: | | ||
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/3.0.0/latest/linux/x64/tar/builds/opensearch/dist/opensearch-min-3.0.0-linux-x64.tar.gz | ||
tar -xzf opensearch-*.tar.gz | ||
rm -f opensearch-*.tar.gz | ||
- name: Download OpenSearch Security Plugin | ||
run: wget -O opensearch-security.zip https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/3.0.0/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-security-3.0.0.0.zip | ||
|
||
|
||
- name: Run OpenSearch with plugin | ||
run: | | ||
cat > os-ep.sh <<EOF | ||
yes | opensearch-plugin install file:///docker-host/security-plugin.zip | ||
chmod +x plugins/opensearch-security/tools/install_demo_configuration.sh | ||
yes | plugins/opensearch-security/tools/install_demo_configuration.sh | ||
echo "plugins.security.unsupported.restapi.allow_securityconfig_modification: true" >> /opensearch/config/opensearch.yml | ||
chown 1001:1001 -R /opensearch | ||
su -c "/opensearch/bin/opensearch" -s /bin/bash opensearch | ||
EOF | ||
docker build -t opensearch-test:latest -f- . <<EOF | ||
FROM ubuntu:latest | ||
COPY --chown=1001:1001 os-ep.sh /docker-host/ | ||
COPY --chown=1001:1001 opensearch-security.zip /docker-host/security-plugin.zip | ||
COPY --chown=1001:1001 opensearch* /opensearch/ | ||
RUN chmod +x /docker-host/os-ep.sh | ||
RUN useradd -u 1001 -s /sbin/nologin opensearch | ||
ENV PATH="/opensearch/bin:${PATH}" | ||
WORKDIR /opensearch/ | ||
ENTRYPOINT /docker-host/os-ep.sh | ||
EOF | ||
docker run -d -p 9200:9200 -p 9600:9600 -i opensearch-test:latest | ||
- name: Checkout OpenSearch Dashboard | ||
uses: actions/checkout@v2 | ||
with: | ||
path: OpenSearch-Dashboards | ||
repository: opensearch-project/OpenSearch-Dashboards | ||
ref: 'main' | ||
fetch-depth: 0 | ||
|
||
- name: Create plugins dir | ||
run: | | ||
cd ./OpenSearch-Dashboards | ||
mkdir -p plugins | ||
- name: Checkout OpenSearch Dashboard Security plugin | ||
uses: actions/checkout@v2 | ||
with: | ||
path: OpenSearch-Dashboards/plugins/security-dashboards-plugin | ||
ref: ${{ github.ref }} | ||
|
||
- name: Check OpenSearch Running | ||
continue-on-error: true | ||
run: curl -XGET https://localhost:9200 -u 'admin:admin' -k | ||
|
||
- name: Get node and yarn versions | ||
id: versions | ||
run: | | ||
echo "::set-output name=node_version::$(cat ./OpenSearch-Dashboards/.node-version)" | ||
echo "::set-output name=yarn_version::$(jq -r '.engines.yarn' ./OpenSearch-Dashboards/package.json)" | ||
- name: Setup node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ steps.versions.outputs.node_version }} | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install correct yarn version for OpenSearch Dashboards | ||
run: | | ||
npm uninstall -g yarn | ||
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}" | ||
npm i -g yarn@${{ steps.versions.outputs.yarn_version }} | ||
- name: Check OpenSearch Running | ||
continue-on-error: true | ||
run: curl -XGET https://localhost:9200 -u 'admin:admin' -k | ||
|
||
- name: Bootstrap OpenSearch Dashboards | ||
continue-on-error: false | ||
run: | | ||
cd ./OpenSearch-Dashboards | ||
yarn osd bootstrap | ||
echo 'server.host: "0.0.0.0"' >> ./config/opensearch_dashboards.yml | ||
echo 'opensearch.hosts: ["https://localhost:9200"]' >> ./config/opensearch_dashboards.yml | ||
echo 'opensearch.ssl.verificationMode: none' >> ./config/opensearch_dashboards.yml | ||
echo 'opensearch.username: "kibanaserver"' >> ./config/opensearch_dashboards.yml | ||
echo 'opensearch.password: "kibanaserver"' >> ./config/opensearch_dashboards.yml | ||
echo 'opensearch.requestHeadersWhitelist: [ authorization,securitytenant ]' >> ./config/opensearch_dashboards.yml | ||
echo 'opensearch_security.multitenancy.enabled: true' >> ./config/opensearch_dashboards.yml | ||
echo 'opensearch_security.multitenancy.tenants.preferred: ["Private", "Global"]' >> ./config/opensearch_dashboards.yml | ||
echo 'opensearch_security.readonly_mode.roles: ["kibana_read_only"]' >> ./config/opensearch_dashboards.yml | ||
echo 'opensearch_security.cookie.secure: false' >> ./config/opensearch_dashboards.yml | ||
echo 'opensearch_security.multitenancy.enable_aggregation_view: true' >> ./config/opensearch_dashboards.yml | ||
yarn start --no-base-path --no-watch & | ||
sleep 300 | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ${{ env.FTR_PATH }} | ||
repository: opensearch-project/opensearch-dashboards-functional-test | ||
ref: 'main' | ||
|
||
- 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 '"')" | ||
- name: Run tests | ||
uses: cypress-io/github-action@v2 | ||
with: | ||
working-directory: ${{ env.FTR_PATH }} | ||
command: yarn cypress:run-with-security-and-aggregation-view --browser chromium --spec ${{ env.SPEC }} |
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
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
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
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
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
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
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
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
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
Oops, something went wrong.