Skip to content

Commit

Permalink
[Security Solution] Cypress: Also cleanup proxy handler projects (ela…
Browse files Browse the repository at this point in the history
…stic#192213)

## Summary

Based on a request in [this
issue](elastic/security-team#10341). The
Cypress cleanup task for serverless testing didn't include a command to
cleanup the project tested against when that project was created using
the proxy handler. This PR adds a second conditional method in the
cleanup task to cleanup projects with the proxy handler when it is in
use.


### Checklist
- [ ] Cypress tests run with proxy handler
- [x] Projects created during a cypress run with the proxy handler are
automatically cleaned up by the cypress cleanup task


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
Co-authored-by: dkirchan <55240027+dkirchan@users.noreply.github.com>
Co-authored-by: Gloria Hornero <gloria.hornero@elastic.co>
  • Loading branch information
5 people authored Feb 12, 2025
1 parent 7a72b14 commit 62977e7
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,10 @@ ${JSON.stringify(cypressConfigFile, null, 2)}
if (cloudHandler instanceof CloudHandler) {
command = `curl -X DELETE ${BASE_ENV_URL}/api/v1/serverless/projects/security/${project.id} -H "Authorization: ApiKey ${API_KEY}"`;
exec(command);
} else if (cloudHandler instanceof ProxyHandler) {
const proxyAuth = btoa(`${PROXY_CLIENT_ID}:${PROXY_SECRET}`);
command = `curl -X DELETE ${PROXY_URL}/projects/${project.id} -H "Authorization: Basic ${proxyAuth}"`;
exec(command);
}
});

Expand Down

0 comments on commit 62977e7

Please sign in to comment.