Skip to content

Commit

Permalink
[8.x] Improves cleanup in spaces data functional test (#198921) (#199024
Browse files Browse the repository at this point in the history
)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Improves cleanup in spaces data functional test
(#198921)](#198921)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Jeramy
Soucy","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-05T16:31:25Z","message":"Improves
cleanup in spaces data functional test (#198921)\n\nCloses
#52714\r\n\r\n## Summary\r\n\r\nUses the sample data FTR service to
remove the sample data via API\r\nduring cleanup. Previously, the after
block only removed the sample data\r\nfrom one space and attempted to
rely on an esArchiver call to clean up\r\nremaining data later on. As
the scope of the test does not use the\r\nesArchiver any longer, it
seems more appropriate to remove the sample\r\ndata more
deterministically.\r\n\r\n### Flaky test
runner\r\n\r\n-\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7335","sha":"b5c8ed7b5c8883993a534626384fe92b728e850c","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Security","release_note:skip","v9.0.0","backport:all-open","FTR"],"title":"Improves
cleanup in spaces data functional
test","number":198921,"url":"https://github.com/elastic/kibana/pull/198921","mergeCommit":{"message":"Improves
cleanup in spaces data functional test (#198921)\n\nCloses
#52714\r\n\r\n## Summary\r\n\r\nUses the sample data FTR service to
remove the sample data via API\r\nduring cleanup. Previously, the after
block only removed the sample data\r\nfrom one space and attempted to
rely on an esArchiver call to clean up\r\nremaining data later on. As
the scope of the test does not use the\r\nesArchiver any longer, it
seems more appropriate to remove the sample\r\ndata more
deterministically.\r\n\r\n### Flaky test
runner\r\n\r\n-\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7335","sha":"b5c8ed7b5c8883993a534626384fe92b728e850c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198921","number":198921,"mergeCommit":{"message":"Improves
cleanup in spaces data functional test (#198921)\n\nCloses
#52714\r\n\r\n## Summary\r\n\r\nUses the sample data FTR service to
remove the sample data via API\r\nduring cleanup. Previously, the after
block only removed the sample data\r\nfrom one space and attempted to
rely on an esArchiver call to clean up\r\nremaining data later on. As
the scope of the test does not use the\r\nesArchiver any longer, it
seems more appropriate to remove the sample\r\ndata more
deterministically.\r\n\r\n### Flaky test
runner\r\n\r\n-\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7335","sha":"b5c8ed7b5c8883993a534626384fe92b728e850c"}}]}]
BACKPORT-->

Co-authored-by: Jeramy Soucy <[email protected]>
  • Loading branch information
kibanamachine and jeramysoucy authored Nov 5, 2024
1 parent ab74598 commit 6fa817a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions x-pack/test/functional/apps/spaces/spaces_selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default function spaceSelectorFunctionalTests({
'spaceSelector',
]);
const spacesService = getService('spaces');
const sampleData = getService('sampleData');

describe('Spaces', function () {
const testSpacesIds = ['another-space', ...Array.from('123456789', (idx) => `space-${idx}`)];
Expand Down Expand Up @@ -158,14 +159,7 @@ export default function spaceSelectorFunctionalTests({
});

after(async () => {
// No need to remove the same sample data in both spaces, the index
// data will be removed in the first call. By feature limitation,
// the created saved objects in the second space will be broken but removed
// when we call esArchiver.unload('x-pack/test/functional/es_archives/spaces').
await PageObjects.common.navigateToApp('home', {
hash: sampleDataHash,
});
await PageObjects.home.removeSampleDataSet('logs');
await sampleData.testResources.removeKibanaSampleData('logs');
await PageObjects.security.forceLogout();
});

Expand Down

0 comments on commit 6fa817a

Please sign in to comment.