-
Notifications
You must be signed in to change notification settings - Fork 1
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
ROR_INTR_001 #3
base: master
Are you sure you want to change the base?
ROR_INTR_001 #3
Conversation
@@ -0,0 +1,109 @@ | |||
// report-generation.spec.ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when I run the single test in cypress UI I got: "Invalid Version: NOT_SET_YET". I recall you had this problem. Could you please tell us how to solve it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to use $ cd e2e-tests; yarn cypress open --env kibanaVersion=[kbnVersion]
, for example $ cd e2e-tests; yarn cypress open --env kibanaVersion=7.17.22
.
README.md file
Cypress tests in interactive GUI
$ cd e2e-tests; yarn cypress open
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I run it locally (8.14.3) and I got sth like this:
@Dzuming could you please check on your side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've checked for KBN 7.17.22 and it works. So it seems the problem is related to KBN 8.x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Dzuming you meant 8.14.3 to 8.15.0? I will change it on the master branch
@lodyczekoladowe so, please take a look at the problem with this test in case of 8.x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you meant 8.14.3 to 8.15.0?
Yes, exactly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in Fixes for new version of es
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments but looks promising
cy.get('tr[data-test-subj="reportJobRow"]').should('not.exist'); | ||
} | ||
|
||
static deleteAllReports(reportTitle: string = 'Untitled discover search') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that it is not possible to delete these reports using the curl command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lodyczekoladowe What about this comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that it is not possible to delete these reports using the curl command.
It should be possible (but also complicated). My proposal, was, to delete the reporting index by the Kibana Api
https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html, thanks to it, all existing reports will be cleared
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That command delate index but don't delate reports. There is no curl command that deletes reports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you remove an ..reporting
index that stores reports, you also remove reports :)
@lodyczekoladowe I can see that you resolved all comments, the good practice is to let resolve a comment from the person who started a conversation. Thanks to it it's easier to track if changes were applied or discuss further. If you resolve an issue, you can leave a message in a thread (for example "resolved"), and I, as a reviewer, will know that I can re-review this specific change. Also, as I see, some changes were not applied, without any comment. Could you leave some comments? |
Okay, I'll leave comments. |
OK, it's done |
} | ||
} | ||
|
||
static generateCsvReport(timeout: number = 50000) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently, we know nothing about the timeout unit. When you use a type that doesn't support it, it's a good practise to add a hint in the param name e.g. timeoutSeconds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleted
} else { | ||
triger = 'CSV created for'; | ||
} | ||
// Attempt to find the "Created report for" message within the timeout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it should work a little bit differently. In this test, we want to check if many reports running at the same time are going to work as expected. In the past, we have a problem with it. When we run reports one by one (waiting for one finish before starting another) everything was OK. But when we run many reports (and the reports generation was scheduled by Kibana to be executed by a different node than the node where the report was scheduled on), there was a problem. This is what we want to test in this task.
So, we want to run many reports one after another. Then we should go to the view where the reports are shown (management sth view) and wait there for the generation finish. When at least one fails, the test should fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s not possible with such a small amount of data—the tests finish too quickly. Since a toast notification pops up every time a report is added to the queue, we have to either remove it or wait for it to disappear, because soon the number of these notifications will block our access to generating new reports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as we talked:
- let's generate huge number of docs
- let's cut off the services resources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in Self-generate invoices data, checking report generation process
@@ -0,0 +1,109 @@ | |||
// report-generation.spec.ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cy.get('tr[data-test-subj="reportJobRow"]').should('not.exist'); | ||
} | ||
|
||
static deleteAllReports(reportTitle: string = 'Untitled discover search') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lodyczekoladowe What about this comment?
# Conflicts: # e2e-tests/cypress.config.ts # e2e-tests/cypress/support/commands.ts # e2e-tests/cypress/support/e2e.ts # e2e-tests/cypress/support/page-objects/Discover.ts # e2e-tests/package.json # e2e-tests/yarn.lock # elk-ror/docker-compose.yml
# organization: beshu-tech | ||
# username: ${{ github.actor }} | ||
# token: ${{ secrets.GITHUB_TOKEN }} | ||
pull_request: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see changes from my branch. For sure sth is wrong here.
items.forEach((item: any) => { | ||
const createResult = item.create; | ||
if (createResult.status === 201) { | ||
console.log(`Invoice ${createResult._id} created successfully.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have to add it? It spams the console with not relevant information
|
||
|
||
before(() => { | ||
dataPut(1000000, indexName, 600, 200); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"dataPut" doesn't tell much about what it does
|
||
export async function dataPut(count: number, indexName: string, chunkSize: number, threads: number): Promise<void> { | ||
count = count / 2; | ||
if (typeof cy.kbnPut !== 'function') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we have to check it?
@@ -0,0 +1,177 @@ | |||
// invoices.ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have SampleData class. Maybe we should add a function that generates invoices in some index there?
}); | ||
} | ||
|
||
function createIndex(indexName: string): Cypress.Chainable<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ES API endpoint Typescript-cypress wrappers should be added in EsApiClient.ts
}).then((response: any) => { | ||
console.log('Response:', response); | ||
if (response) { | ||
if (response.error && response.error.type === 'resource_already_exists_exception') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no need to do this. We should just assert that the response returned 2xx.
const chunks = chunkArray(invoices, chunkSize); | ||
|
||
const processChunk = async (chunk: any[], index: number) => { | ||
cy.esPost({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same - should be moved to EsApiClient
import { Reports } from "../support/page-objects/management/Reports"; | ||
import { dataPut } from "../support/page-objects/invoices"; | ||
|
||
describe('Report Generation', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran the test - it's way too SLOOOOW.
Do we need so much data?
Added test for generating rapports form data.
Task description