-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 some type issues in x-pack/test #167343
Changes from 5 commits
0b83ddf
b0b8631
b0673b7
555deac
386bab7
0089892
3e73052
2c404f0
40057c2
5589eef
7b58719
078399f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,7 +152,7 @@ export default ({ getService }: FtrProviderContext) => { | |
await waitForSignalsToBePresent(supertest, log, 1, [id]); | ||
const signalsOpen = await getSignalsById(supertest, log, id); | ||
const ips = signalsOpen.hits.hits.map((hit) => hit._source?.ip).sort(); | ||
expect(ips.flat(Number.MAX_SAFE_INTEGER)).to.eql([]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this would kill the typescript typecheck by saying the expanded type is infinitely deep |
||
expect(ips.flat(10)).to.eql([]); | ||
}); | ||
|
||
it('should filter a CIDR range of "127.0.0.1/30"', async () => { | ||
|
@@ -347,7 +347,7 @@ export default ({ getService }: FtrProviderContext) => { | |
await waitForSignalsToBePresent(supertest, log, 1, [id]); | ||
const signalsOpen = await getSignalsById(supertest, log, id); | ||
const ips = signalsOpen.hits.hits.map((hit) => hit._source?.ip).sort(); | ||
expect(ips.flat(Number.MAX_SAFE_INTEGER)).to.eql([]); | ||
expect(ips.flat(10)).to.eql([]); | ||
}); | ||
}); | ||
|
||
|
@@ -409,7 +409,7 @@ export default ({ getService }: FtrProviderContext) => { | |
await waitForSignalsToBePresent(supertest, log, 1, [id]); | ||
const signalsOpen = await getSignalsById(supertest, log, id); | ||
const ips = signalsOpen.hits.hits.map((hit) => hit._source?.ip).sort(); | ||
expect(ips.flat(Number.MAX_SAFE_INTEGER)).to.eql([]); | ||
expect(ips.flat(10)).to.eql([]); | ||
}); | ||
}); | ||
|
||
|
@@ -514,7 +514,7 @@ export default ({ getService }: FtrProviderContext) => { | |
await waitForSignalsToBePresent(supertest, log, 1, [id]); | ||
const signalsOpen = await getSignalsById(supertest, log, id); | ||
const ips = signalsOpen.hits.hits.map((hit) => hit._source?.ip).sort(); | ||
expect(ips.flat(Number.MAX_SAFE_INTEGER)).to.eql([]); | ||
expect(ips.flat(10)).to.eql([]); | ||
}); | ||
|
||
it('will return 2 results if we have a list which contains the CIDR ranges of "127.0.0.1/32, 127.0.0.2/31, 127.0.0.4/30"', async () => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,7 +126,11 @@ export default function (providerContext: FtrProviderContext) { | |
); | ||
}); | ||
|
||
async function waitForAgents(expectedAgentCount: number, attempts: number, _attemptsMade = 0) { | ||
async function waitForAgents( | ||
expectedAgentCount: number, | ||
attempts: number, | ||
_attemptsMade = 0 | ||
): Promise<any> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the tip. I opened a PR to fix: #167488 |
||
const { body: apiResponse } = await supertest | ||
.get(`/api/fleet/agents?showInactive=true`) | ||
.set('kbn-xsrf', 'xxxx') | ||
|
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 can't see that this is used outside of this file?
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.
maybe it's no longer relevant, but it was used in another time when this was fixed :/