Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/babel/traverse-7.23.2
Browse files Browse the repository at this point in the history
Signed-off-by: Rupal Mahajan <maharup@amazon.com>
  • Loading branch information
rupal-bq committed Mar 21, 2024
2 parents 366dfb1 + 445e108 commit d6fa311
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/reporting-cli-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ jobs:
with:
timeout_seconds: 1
max_attempts: 30
command: curl https://localhost:9200 -ku 'admin:admin'
command: curl https://localhost:9200 -ku 'admin:myStrongPassword123!'
retry_wait_seconds: 30

- name: Add sample data
run: |
curl -XPOST -u 'admin:admin' 'http://localhost:5601/api/sample_data/ecommerce' -H 'osd-xsrf:true'
curl -XPOST -u 'admin:admin' 'http://localhost:5601/api/sample_data/logs' -H 'osd-xsrf:true' -H 'securitytenant: global'
curl -XPOST -u 'admin:admin' 'http://localhost:5601/api/sample_data/flights' -H 'osd-xsrf:true' -H 'securitytenant: admin_tenant'
curl -XPOST -u 'admin:myStrongPassword123!' 'http://localhost:5601/api/sample_data/ecommerce' -H 'osd-xsrf:true'
curl -XPOST -u 'admin:myStrongPassword123!' 'http://localhost:5601/api/sample_data/logs' -H 'osd-xsrf:true' -H 'securitytenant: global'
curl -XPOST -u 'admin:myStrongPassword123!' 'http://localhost:5601/api/sample_data/flights' -H 'osd-xsrf:true' -H 'securitytenant: admin_tenant'
- name: Run integration tests
run: |
Expand Down
7 changes: 3 additions & 4 deletions test/errors.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ describe('download report errors', () => {
expect(result.stderr).toContain('error: option \'-f, --format <type>\' argument \'txt\' is invalid. Allowed choices are pdf, png, csv.');
});

test('invalid tenant', async () => {
let result = await cli(['-u', `${url}/app/dashboards#/view/edf84fe0-e1a0-11e7-b6d5-4dc382ef7f5b`, '-a', 'basic', '-c', credentials,
'-t', 'custom'], '.');
test('saved search error', async () => {
let result = await cli(['-u', `${url}/app/data-explorer/discover#/`, '-a', 'basic', '-c', credentials, '-f', 'csv'], '.');
expect(result.code).toBe(1);
expect(result.stderr).toContain('Invalid tenant');
expect(result.stderr).toContain('Please save search and retry');
}, 150000);

test('missing transport value', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/format.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('report format option', () => {
}, 30000);

test('download csv report', async () => {
let result = await cli(['-u', `${url}/app/data-explorer/discover/#/view/3ba638e0-b894-11e8-a6d9-e546fe2bba5f`, '-a', 'basic', '-c', credentials,
let result = await cli(['-u', `${url}/app/data-explorer/discover#/view/3ba638e0-b894-11e8-a6d9-e546fe2bba5f`, '-a', 'basic', '-c', credentials,
'-n', 'testdownloadcsv', '-f', 'csv'], '.');
expect(result.code).toBe(0);
const expectedFile = './testdownloadcsv.csv';
Expand Down
10 changes: 0 additions & 10 deletions test/misc.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,4 @@ describe('download report errors', () => {
expect(stats.size >= 0).toBeTruthy();
fs.unlinkSync(expectedFile);
}, 150000);

test('download csv report from custom tenant', async () => {
let result = await cli(['-u', `${url}/app/data-explorer/discover/#/view/571aaf70-4c88-11e8-b3d7-01146121b73d`, '-a', 'basic', '-c', credentials,
'-n', 'testcsvoncustomtenant', '-t', 'admin_tenant', '-f', 'csv'], '.');
expect(result.code).toBe(0);
const expectedFile = './testcsvoncustomtenant.csv';
const stats = fs.statSync(expectedFile);
expect(stats.size >= 0).toBeTruthy();
fs.unlinkSync(expectedFile);
}, 150000);
});

0 comments on commit d6fa311

Please sign in to comment.