-
Notifications
You must be signed in to change notification settings - Fork 162
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
Saved Object Aggregation View #1146
Merged
Merged
Changes from 7 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
89a6a57
Saved Object Aggregation View (#1142)
cliu123 5757ccf
[WIP]2.x cypress test ci (#1143)
RyanL1997 548eefa
Add constants and specify types (#1144)
cliu123 24d2c12
Define variables and functions (#1145)
cliu123 f6d4710
change versions to main branch in cypress workflow
RyanL1997 3d1c7ac
Define functions for global and private tenant cases (#1147)
cliu123 712db07
change cypress path (#1149)
RyanL1997 52bb373
[Feature Branch] Resolve review comments (#1152)
cliu123 e204d71
Use `typeToNamespacesMap` to resolve Advanced Settings sharing id issue
cliu123 fa1436c
[Feature Branch] Resolve review comments (#1154)
cliu123 2a827da
[Feature Branch] Resolve review comments (#1155)
cliu123 54ae31d
change the cypress functional test reference to functional test repo …
RyanL1997 0354aa5
[Feature Branch] Resolve review comments (#1158)
cliu123 4e67d39
Resolve review comments (#1159)
cliu123 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,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: | ||
peternied marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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: RyanL1997/opensearch-dashboards-functional-test | ||
peternied marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ref: 'saved-objects-test' | ||
|
||
- 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 }} | ||
peternied marked this conversation as resolved.
Show resolved
Hide resolved
|
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
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.
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.
should this changed to a folder path? Could be done in future if we are planning to add and test more cypress tests.