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

Failing test: X-Pack Reporting API Integration Tests.x-pack/test/reporting_api_integration/reporting_and_security/usage/api_counters·ts - Reporting APIs Usage Usage Counters API counters: management job info #149942

Closed
kibanamachine opened this issue Jan 31, 2023 · 7 comments · Fixed by #162288
Labels
failed-test A test failure on a tracked branch, potentially flaky-test Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)

Comments

@kibanamachine
Copy link
Contributor

kibanamachine commented Jan 31, 2023

A test failed on a tracked branch

Error: expected 1 to equal 0
    at Assertion.assert (expect.js:100:11)
    at Assertion.apply (expect.js:227:8)
    at Assertion.be (expect.js:69:22)
    at Context.apply (api_counters.ts:90:14)
    at Object.apply (wrap_function.js:73:30)

First failure: CI Build - main

@kibanamachine kibanamachine added the failed-test A test failure on a tracked branch, potentially flaky-test label Jan 31, 2023
@botelastic botelastic bot added the needs-team Issues missing a team label label Jan 31, 2023
@mistic mistic added the Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) label Jan 31, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Jan 31, 2023
@kibanamachine
Copy link
Contributor Author

New failure: CI Build - main

@kibanamachine
Copy link
Contributor Author

New failure: CI Build - main

@kibanamachine
Copy link
Contributor Author

New failure: CI Build - main

@jbudz
Copy link
Member

jbudz commented Feb 6, 2023

/skip

@kibanamachine
Copy link
Contributor Author

Skipped

main: c37e254

@tsullivan
Copy link
Member

We're replacing API integration testing for this, and replacing the tests of the functionality with unit tests in this PR: #162288

tsullivan added a commit that referenced this issue Aug 1, 2023
…162288)

## Summary

Closes #160827
Closes #134517
Closes #149942

In this PR, the following API endpoints are moved into an internal
namespace:

| New endpoint path | Previous |
|---|---|
| `/internal/reporting/diagnose/browser` |
`/api/reporting/diagnose/browser` |
| `/internal/reporting/diagnose/screenshot` |
`/api/reporting/diagnose/screenshot` |
| `/internal/reporting/generate/immediate/csv_searchsource` |
`/api/reporting/v1/generate/immediate/csv_searchsource` |
| `/internal/reporting/generate/{exportTypeId}` |
`/api/reporting/generate/{exportTypeId}` |
| `/internal/reporting/jobs/count` | `/api/reporting/jobs/count` |
| `/internal/reporting/jobs/delete/{jobId}` |
`/api/reporting/jobs/delete/{jobId}` |
| `/internal/reporting/jobs/info/{jobId}` |
`/api/reporting/jobs/info/{jobId}` |
| `/internal/reporting/jobs/list` | `/api/reporting/jobs/list` |

Support for the public APIs continues:

| Public endpoint path |
|---|
| `/api/reporting/generate/{exportTypeId}` |
| `/api/reporting/jobs/delete/{jobId}` |
| `/api/reporting/jobs/download/{jobId}` |

## Other changes
1. Set access options on the routes
2. Removed API Counter functional tests, which were skipped to begin
with.
3. Replaced functional tests with Jest integration tests.
4. Consolidated code in the generation routes by creating the
`getJobParams` method of the `RequestHandler` class.
5. Added a new test for `getJobParams` 
6. Consolidated code in the job management routes 
7. Added new code for shared helpers in job management routes 
8. Reorganized libs used for route handlers:
    ```
routes/lib/request_handler.ts =>
routes/common/generate/request_handler.ts
routes/lib/job_management_pre_routing.ts =>
routes/common/jobs/job_management_pre_routing.ts
routes/lib/jobs_query.ts => routes/common/jobs/jobs_query.ts
routes/lib/get_document_payload.ts =>
routes/common/jobs/get_document_payload.ts
routes/lib/get_counter.ts => routes/common/get_counter.ts
routes/lib/authorized_user_pre_routing.ts =>
routes/common/authorized_user_pre_routing.ts
routes/lib/get_user.ts => routes/common/get_user.ts
   ```

## Release Note
Updated API endpoint paths for Reporting to clarify which routes are
public and which are not. Make sure that any custom script or
application that uses Reporting endpoints only uses the public
endpoints.

---------

Co-authored-by: kibanamachine <[email protected]>
ThomThomson pushed a commit to ThomThomson/kibana that referenced this issue Aug 1, 2023
…lastic#162288)

## Summary

Closes elastic#160827
Closes elastic#134517
Closes elastic#149942

In this PR, the following API endpoints are moved into an internal
namespace:

| New endpoint path | Previous |
|---|---|
| `/internal/reporting/diagnose/browser` |
`/api/reporting/diagnose/browser` |
| `/internal/reporting/diagnose/screenshot` |
`/api/reporting/diagnose/screenshot` |
| `/internal/reporting/generate/immediate/csv_searchsource` |
`/api/reporting/v1/generate/immediate/csv_searchsource` |
| `/internal/reporting/generate/{exportTypeId}` |
`/api/reporting/generate/{exportTypeId}` |
| `/internal/reporting/jobs/count` | `/api/reporting/jobs/count` |
| `/internal/reporting/jobs/delete/{jobId}` |
`/api/reporting/jobs/delete/{jobId}` |
| `/internal/reporting/jobs/info/{jobId}` |
`/api/reporting/jobs/info/{jobId}` |
| `/internal/reporting/jobs/list` | `/api/reporting/jobs/list` |

Support for the public APIs continues:

| Public endpoint path |
|---|
| `/api/reporting/generate/{exportTypeId}` |
| `/api/reporting/jobs/delete/{jobId}` |
| `/api/reporting/jobs/download/{jobId}` |

## Other changes
1. Set access options on the routes
2. Removed API Counter functional tests, which were skipped to begin
with.
3. Replaced functional tests with Jest integration tests.
4. Consolidated code in the generation routes by creating the
`getJobParams` method of the `RequestHandler` class.
5. Added a new test for `getJobParams` 
6. Consolidated code in the job management routes 
7. Added new code for shared helpers in job management routes 
8. Reorganized libs used for route handlers:
    ```
routes/lib/request_handler.ts =>
routes/common/generate/request_handler.ts
routes/lib/job_management_pre_routing.ts =>
routes/common/jobs/job_management_pre_routing.ts
routes/lib/jobs_query.ts => routes/common/jobs/jobs_query.ts
routes/lib/get_document_payload.ts =>
routes/common/jobs/get_document_payload.ts
routes/lib/get_counter.ts => routes/common/get_counter.ts
routes/lib/authorized_user_pre_routing.ts =>
routes/common/authorized_user_pre_routing.ts
routes/lib/get_user.ts => routes/common/get_user.ts
   ```

## Release Note
Updated API endpoint paths for Reporting to clarify which routes are
public and which are not. Make sure that any custom script or
application that uses Reporting endpoints only uses the public
endpoints.

---------

Co-authored-by: kibanamachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
failed-test A test failure on a tracked branch, potentially flaky-test Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants