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

Remove unnecessary labels from spec files #3060

Merged
merged 6 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
502 changes: 249 additions & 253 deletions cypress/e2e/awx/access/teams/teams.cy.ts

Large diffs are not rendered by default.

143 changes: 70 additions & 73 deletions cypress/e2e/awx/cleanup/awx-cleanup.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,97 +7,94 @@ import { Project } from '../../../../frontend/awx/interfaces/Project';
import { AwxUser } from '../../../../frontend/awx/interfaces/User';
import { WorkflowApproval } from '../../../../frontend/awx/interfaces/WorkflowApproval';
import { getJobsAPIUrl } from '../../../../frontend/awx/views/jobs/jobUtils';
import { cyLabel } from '../../../support/cyLabel';
import { awxAPI } from '../../../support/formatApiPathForAwx';

const twoHoursAgo = new Date(Date.now() - 2 * 60 * 60 * 1000).toISOString();

cyLabel(['upstream'], () => {
describe('AWX Cleanup', () => {
it('cleanup projects', () => {
cy.requestGet<AwxItemsResponse<Project>>(
awxAPI`/projects?name__startswith=E2E&page=1&page_size=200&created__lt=${twoHoursAgo}`
).then((result) => {
for (const resource of result.results ?? []) {
cy.deleteAwxProject(resource, { failOnStatusCode: false });
}
});
describe('AWX Cleanup', () => {
it('cleanup projects', () => {
cy.requestGet<AwxItemsResponse<Project>>(
awxAPI`/projects?name__startswith=E2E&page=1&page_size=200&created__lt=${twoHoursAgo}`
).then((result) => {
for (const resource of result.results ?? []) {
cy.deleteAwxProject(resource, { failOnStatusCode: false });
}
});
});

it('cleanup inventories', () => {
cy.requestGet<AwxItemsResponse<Inventory>>(
awxAPI`/inventories?name__startswith=E2E&page=1&page_size=200&created__lt=${twoHoursAgo}`
).then((result) => {
for (const resource of result.results ?? []) {
cy.deleteAwxInventory(resource, { failOnStatusCode: false });
}
});
it('cleanup inventories', () => {
cy.requestGet<AwxItemsResponse<Inventory>>(
awxAPI`/inventories?name__startswith=E2E&page=1&page_size=200&created__lt=${twoHoursAgo}`
).then((result) => {
for (const resource of result.results ?? []) {
cy.deleteAwxInventory(resource, { failOnStatusCode: false });
}
});
});

it('cleanup organizations', () => {
cy.requestGet<AwxItemsResponse<Organization>>(
awxAPI`/organizations?name__startswith=E2E&page=1&page_size=200&created__lt=${twoHoursAgo}`
).then((result) => {
for (const resource of result.results ?? []) {
cy.deleteAwxOrganization(resource, { failOnStatusCode: false });
}
});
it('cleanup organizations', () => {
cy.requestGet<AwxItemsResponse<Organization>>(
awxAPI`/organizations?name__startswith=E2E&page=1&page_size=200&created__lt=${twoHoursAgo}`
).then((result) => {
for (const resource of result.results ?? []) {
cy.deleteAwxOrganization(resource, { failOnStatusCode: false });
}
});
});

it('cleanup users', () => {
cy.requestGet<AwxItemsResponse<AwxUser>>(
awxAPI`/users?username__startswith=e2e-&page=1&page_size=200&created__lt=${twoHoursAgo}`
).then((result) => {
for (const resource of result.results ?? []) {
cy.deleteAwxUser(resource, { failOnStatusCode: false });
}
});
it('cleanup users', () => {
cy.requestGet<AwxItemsResponse<AwxUser>>(
awxAPI`/users?username__startswith=e2e-&page=1&page_size=200&created__lt=${twoHoursAgo}`
).then((result) => {
for (const resource of result.results ?? []) {
cy.deleteAwxUser(resource, { failOnStatusCode: false });
}
});
});

it('cleanup templates', () => {
cy.requestGet<AwxItemsResponse<JobTemplate>>(
awxAPI`/unified_job_templates/?name__startswith=E2E&page=1&page_size=200&created__lt=${twoHoursAgo}`
).then((result) => {
for (const resource of result.results ?? []) {
cy.deleteAwxJobTemplate(resource, { failOnStatusCode: false });
}
});
it('cleanup templates', () => {
cy.requestGet<AwxItemsResponse<JobTemplate>>(
awxAPI`/unified_job_templates/?name__startswith=E2E&page=1&page_size=200&created__lt=${twoHoursAgo}`
).then((result) => {
for (const resource of result.results ?? []) {
cy.deleteAwxJobTemplate(resource, { failOnStatusCode: false });
}
});
});

it('cleanup jobs', () => {
cy.requestGet<AwxItemsResponse<Job>>(
awxAPI`/unified_jobs/?name__startswith=E2E&page=1&page_size=200&created__lt=${twoHoursAgo}`
).then((result) => {
for (const resource of result.results ?? []) {
const url = getJobsAPIUrl(resource.job_type ?? '');
cy.requestDelete(`${url}${resource.id}/`, { failOnStatusCode: false });
}
});
it('cleanup jobs', () => {
cy.requestGet<AwxItemsResponse<Job>>(
awxAPI`/unified_jobs/?name__startswith=E2E&page=1&page_size=200&created__lt=${twoHoursAgo}`
).then((result) => {
for (const resource of result.results ?? []) {
const url = getJobsAPIUrl(resource.job_type ?? '');
cy.requestDelete(`${url}${resource.id}/`, { failOnStatusCode: false });
}
});
});

it('cleanup instance groups', () => {
cy.requestGet<AwxItemsResponse<Job>>(
awxAPI`/instance_groups/?name__startswith=E2E&page=1&page_size=200&created__lt=${twoHoursAgo}`
).then((result) => {
for (const resource of result.results ?? []) {
cy.requestDelete(awxAPI`/instance_groups/${resource.id.toString()}/`, {
failOnStatusCode: false,
});
}
});
it('cleanup instance groups', () => {
cy.requestGet<AwxItemsResponse<Job>>(
awxAPI`/instance_groups/?name__startswith=E2E&page=1&page_size=200&created__lt=${twoHoursAgo}`
).then((result) => {
for (const resource of result.results ?? []) {
cy.requestDelete(awxAPI`/instance_groups/${resource.id.toString()}/`, {
failOnStatusCode: false,
});
}
});
});

it('cleanup workflow approvals', () => {
cy.requestGet<AwxItemsResponse<WorkflowApproval>>(
awxAPI`/workflow_approvals/?name__startswith=E2E&page=1&page_size=200&created__lt=${twoHoursAgo}`
).then((result) => {
for (const resource of result.results ?? []) {
cy.requestPost(awxAPI`/workflow_approvals/${resource.id.toString()}/deny/`, {}, false);
cy.requestDelete(awxAPI`/workflow_approvals/${resource.id.toString()}/`, {
failOnStatusCode: false,
});
}
});
it('cleanup workflow approvals', () => {
cy.requestGet<AwxItemsResponse<WorkflowApproval>>(
awxAPI`/workflow_approvals/?name__startswith=E2E&page=1&page_size=200&created__lt=${twoHoursAgo}`
).then((result) => {
for (const resource of result.results ?? []) {
cy.requestPost(awxAPI`/workflow_approvals/${resource.id.toString()}/deny/`, {}, false);
cy.requestDelete(awxAPI`/workflow_approvals/${resource.id.toString()}/`, {
failOnStatusCode: false,
});
}
});
});
});
Loading
Loading