diff --git a/.github/workflows/reporting-cli-test-workflow.yml b/.github/workflows/reporting-cli-test-workflow.yml index 29c881b..70d96d2 100644 --- a/.github/workflows/reporting-cli-test-workflow.yml +++ b/.github/workflows/reporting-cli-test-workflow.yml @@ -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: | diff --git a/test/errors.test.js b/test/errors.test.js index 1b2ed76..4f1f642 100644 --- a/test/errors.test.js +++ b/test/errors.test.js @@ -33,11 +33,10 @@ describe('download report errors', () => { expect(result.stderr).toContain('error: option \'-f, --format \' 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 () => { diff --git a/test/format.test.js b/test/format.test.js index 19731b9..ca5c44d 100644 --- a/test/format.test.js +++ b/test/format.test.js @@ -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'; diff --git a/test/misc.test.js b/test/misc.test.js index 46e9961..20dc8e5 100644 --- a/test/misc.test.js +++ b/test/misc.test.js @@ -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); });