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

Move in-cluster eventing sub-test to the fixture #12115

Merged
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
8 changes: 2 additions & 6 deletions tests/fast-integration/test/1-commerce-mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,8 @@ describe("CommerceMock tests", function () {
});
});

it("in-cluster event should be delivered (structured mode)", async function () {
await checkInClusterEventDelivery(testNamespace, 'structured');
});

it("in-cluster event should be delivered (binary mode)", async function () {
await checkInClusterEventDelivery(testNamespace, 'binary');
it("in-cluster event should be delivered (structured and binary mode)", async function () {
await checkInClusterEventDelivery(testNamespace);
});

it("function should be reachable through secured API Rule", async function () {
Expand Down
9 changes: 7 additions & 2 deletions tests/fast-integration/test/fixtures/commerce-mock/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ function cleanMockTestFixture(mockNamespace, targetNamespace, wait = true) {
}

async function deleteMockTestFixture(targetNamespace) {

const serviceBindingUsage = {
apiVersion: "servicecatalog.kyma-project.io/v1alpha1",
kind: "ServiceBindingUsage",
Expand All @@ -487,7 +486,13 @@ async function deleteMockTestFixture(targetNamespace) {
await k8sDelete(commerceObjs)
await k8sDelete(applicationObjs)
}
async function checkInClusterEventDelivery(targetNamespace, encoding) {

async function checkInClusterEventDelivery(targetNamespace) {
await checkInClusterEventDeliveryHelper(targetNamespace, 'structured');
await checkInClusterEventDeliveryHelper(targetNamespace, 'binary');
}

async function checkInClusterEventDeliveryHelper(targetNamespace, encoding) {
const eventId = "event-" + genRandom(5);
const vs = await waitForVirtualService(targetNamespace, "lastorder");
const mockHost = vs.spec.hosts[0];
Expand Down