Skip to content

Commit

Permalink
Add infra support and helper function to create real datasource
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Ho <[email protected]>
  • Loading branch information
derek-ho committed Mar 14, 2024
1 parent 736a788 commit be94338
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/release-signoff-chrome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ jobs:
cd opensearch-${{ env.VERSION }}/
./opensearch-tar-install.sh &
timeout 900 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' -u admin:${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }} -k https://localhost:9200)" != "200" ]]; do sleep 5; done'
- uses: derek-ho/start-opensearch@v3
with:
opensearch-version: ${{ env.VERSION }}
security-enabled: false
port: 9201
- name: Get OpenSearch-Dashboards
run: |
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/${{ env.VERSION }}/latest/linux/x64/tar/dist/opensearch-dashboards/opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release-signoff-chromium-ad-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ jobs:
cd opensearch-${{ env.VERSION }}/
./opensearch-tar-install.sh &
timeout 900 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' -u admin:${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }} -k https://localhost:9200)" != "200" ]]; do sleep 5; done'
- uses: derek-ho/start-opensearch@v3
with:
opensearch-version: ${{ env.VERSION }}
security-enabled: false
port: 9201
- name: Get OpenSearch-Dashboards
run: |
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/${{ env.VERSION }}/latest/linux/x64/tar/dist/opensearch-dashboards/opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release-signoff-chromium-ism-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ jobs:
cd opensearch-${{ env.VERSION }}/
./opensearch-tar-install.sh &
timeout 900 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' -u admin:${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }} -k https://localhost:9200)" != "200" ]]; do sleep 5; done'
- uses: derek-ho/start-opensearch@v3
with:
opensearch-version: ${{ env.VERSION }}
security-enabled: false
port: 9201
- name: Get OpenSearch-Dashboards
run: |
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/${{ env.VERSION }}/latest/linux/x64/tar/dist/opensearch-dashboards/opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ const REGION = 'us-east-1';
const ACCESS_KEY = 'accessKey';
const SECRET_KEY = 'secretKey';

export const CreateDataSourceNoAuth = () => {
cy.visit(
'http://localhost:5601/app/management/opensearch-dashboards/dataSources/create'
);
cy.get('[data-test-subj="createDataSourceFormTitleField"]').type('9201');
cy.get('[data-test-subj="createDataSourceFormEndpointField"]').type(
'http://localhost:9201'
);
cy.get('[data-test-subj="createDataSourceFormAuthTypeSelect"]').click();
cy.get('#no_auth').click();
cy.get('[data-test-subj="createDataSourceTestConnectionButton"]').click();
cy.get('.euiToastHeader__title').should('contain', 'successful');
cy.get('[data-test-subj="createDataSourceButton"]').click();
};

// TODO: create datasource with basic auth and sigv4

if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
describe('Create datasources', () => {
before(() => {
Expand Down
15 changes: 15 additions & 0 deletions cypress/utils/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,21 @@ Cypress.Commands.add('createIndexPattern', (id, attributes, header = {}) => {
Cypress.config().baseUrl
}/api/saved_objects/index-pattern/${id}`;

console.log(JSON.stringify(url));
console.log(
JSON.stringify({
'content-type': 'application/json;charset=UTF-8',
'osd-xsrf': true,
...header,
})
);
console.log(
JSON.stringify({
attributes,
references: [],
})
);

cy.request({
method: 'POST',
url,
Expand Down

0 comments on commit be94338

Please sign in to comment.