Skip to content
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

Fix CI #69

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
9 changes: 1 addition & 8 deletions test/errors.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,8 @@ 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'], '.');
expect(result.code).toBe(1);
expect(result.stderr).toContain('Invalid tenant');
}, 150000);

test('saved search error', async () => {
let result = await cli(['-u', `${url}/app/discover#/`, '-a', 'basic', '-c', credentials, '-f', 'csv'], '.');
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('Please save search and retry');
}, 150000);
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/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/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);
});
Loading