Skip to content

Commit e20c725

Browse files
authored
Merge pull request #138 from kstekovi/EAP7-2055
EAP7-2055 Add Support for OpenTelemetry in the console
2 parents 553abd6 + d517ae7 commit e20c725

3 files changed

Lines changed: 208 additions & 18 deletions

File tree

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
describe("TESTS: Configuration => Subsystem => OpenTelemetry", () => {
2+
const address = ["subsystem", "opentelemetry"];
3+
const configurationFormId = "model-browser-model-browser-root-form";
4+
5+
// Attribute names
6+
const serviceName = "service-name";
7+
const endpoint = "endpoint";
8+
const exporterType = "exporter-type";
9+
const spanProcessorType = "span-processor-type";
10+
const batchDelay = "batch-delay";
11+
const maxQueueSize = "max-queue-size";
12+
const maxExportBatchSize = "max-export-batch-size";
13+
const exportTimeout = "export-timeout";
14+
const samplerType = "sampler-type";
15+
const ratio = "ratio";
16+
17+
let managementEndpoint: string;
18+
19+
before(() => {
20+
cy.startWildflyContainer({ configuration: "standalone-microprofile-insecure.xml" }).then((result) => {
21+
managementEndpoint = result as string;
22+
});
23+
});
24+
25+
after(() => {
26+
cy.task("stop:containers");
27+
});
28+
29+
it("Edit service-name", () => {
30+
const customServiceName = "my-otel-service";
31+
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
32+
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
33+
cy.editForm(configurationFormId);
34+
cy.text(configurationFormId, serviceName, customServiceName);
35+
cy.saveForm(configurationFormId);
36+
cy.verifySuccess();
37+
cy.verifyAttribute(managementEndpoint, address, serviceName, customServiceName);
38+
});
39+
40+
it("Edit endpoint", () => {
41+
const customEndpoint = "http://otel-collector:4317";
42+
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
43+
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
44+
cy.editForm(configurationFormId);
45+
cy.text(configurationFormId, endpoint, customEndpoint);
46+
cy.saveForm(configurationFormId);
47+
cy.verifySuccess();
48+
cy.verifyAttribute(managementEndpoint, address, endpoint, customEndpoint);
49+
});
50+
51+
it("Edit endpoint with expression", () => {
52+
const expressionValue = "${env.OTEL_ENDPOINT:http://localhost:4317}";
53+
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
54+
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
55+
cy.editForm(configurationFormId);
56+
cy.textExpression(configurationFormId, endpoint, expressionValue);
57+
cy.saveForm(configurationFormId);
58+
cy.verifySuccess();
59+
cy.verifyAttributeAsExpression(managementEndpoint, address, endpoint, expressionValue);
60+
});
61+
62+
it("Change exporter-type to jaeger", () => {
63+
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
64+
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
65+
cy.editForm(configurationFormId);
66+
cy.selectInDropdownMenu(configurationFormId, exporterType, "jaeger");
67+
cy.saveForm(configurationFormId);
68+
cy.verifySuccess();
69+
cy.verifyAttribute(managementEndpoint, address, exporterType, "jaeger");
70+
});
71+
72+
it("Change exporter-type to otlp", () => {
73+
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
74+
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
75+
cy.editForm(configurationFormId);
76+
cy.selectInDropdownMenu(configurationFormId, exporterType, "otlp");
77+
cy.saveForm(configurationFormId);
78+
cy.verifySuccess();
79+
cy.verifyAttribute(managementEndpoint, address, exporterType, "otlp");
80+
});
81+
82+
it("Change span-processor-type to simple", () => {
83+
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
84+
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
85+
cy.editForm(configurationFormId);
86+
cy.selectInDropdownMenu(configurationFormId, spanProcessorType, "simple");
87+
cy.saveForm(configurationFormId);
88+
cy.verifySuccess();
89+
cy.verifyAttribute(managementEndpoint, address, spanProcessorType, "simple");
90+
});
91+
92+
it("Change span-processor-type to batch", () => {
93+
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
94+
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
95+
cy.editForm(configurationFormId);
96+
cy.selectInDropdownMenu(configurationFormId, spanProcessorType, "batch");
97+
cy.saveForm(configurationFormId);
98+
cy.verifySuccess();
99+
cy.verifyAttribute(managementEndpoint, address, spanProcessorType, "batch");
100+
});
101+
102+
it("Edit batch-delay", () => {
103+
const customBatchDelay = 10000;
104+
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
105+
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
106+
cy.editForm(configurationFormId);
107+
cy.text(configurationFormId, batchDelay, customBatchDelay);
108+
cy.saveForm(configurationFormId);
109+
cy.verifySuccess();
110+
cy.verifyAttribute(managementEndpoint, address, batchDelay, customBatchDelay);
111+
});
112+
113+
it("Edit max-queue-size", () => {
114+
const customMaxQueueSize = 4096;
115+
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
116+
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
117+
cy.editForm(configurationFormId);
118+
cy.text(configurationFormId, maxQueueSize, customMaxQueueSize);
119+
cy.saveForm(configurationFormId);
120+
cy.verifySuccess();
121+
cy.verifyAttribute(managementEndpoint, address, maxQueueSize, customMaxQueueSize);
122+
});
123+
124+
it("Edit max-export-batch-size", () => {
125+
const customMaxExportBatchSize = 1024;
126+
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
127+
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
128+
cy.editForm(configurationFormId);
129+
cy.text(configurationFormId, maxExportBatchSize, customMaxExportBatchSize);
130+
cy.saveForm(configurationFormId);
131+
cy.verifySuccess();
132+
cy.verifyAttribute(managementEndpoint, address, maxExportBatchSize, customMaxExportBatchSize);
133+
});
134+
135+
it("Edit export-timeout", () => {
136+
const customExportTimeout = 60000;
137+
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
138+
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
139+
cy.editForm(configurationFormId);
140+
cy.text(configurationFormId, exportTimeout, customExportTimeout);
141+
cy.saveForm(configurationFormId);
142+
cy.verifySuccess();
143+
cy.verifyAttribute(managementEndpoint, address, exportTimeout, customExportTimeout);
144+
});
145+
146+
it("Change sampler-type to on", () => {
147+
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
148+
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
149+
cy.editForm(configurationFormId);
150+
cy.selectInDropdownMenu(configurationFormId, samplerType, "on");
151+
cy.saveForm(configurationFormId);
152+
cy.verifySuccess();
153+
cy.verifyAttribute(managementEndpoint, address, samplerType, "on");
154+
});
155+
156+
it("Change sampler-type to off", () => {
157+
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
158+
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
159+
cy.editForm(configurationFormId);
160+
cy.selectInDropdownMenu(configurationFormId, samplerType, "off");
161+
cy.saveForm(configurationFormId);
162+
cy.verifySuccess();
163+
cy.verifyAttribute(managementEndpoint, address, samplerType, "off");
164+
});
165+
166+
it("Change sampler-type to ratio and set ratio value", () => {
167+
const ratioValue = 0.5;
168+
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
169+
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
170+
cy.editForm(configurationFormId);
171+
cy.selectInDropdownMenu(configurationFormId, samplerType, "ratio");
172+
cy.text(configurationFormId, ratio, ratioValue);
173+
cy.saveForm(configurationFormId);
174+
cy.verifySuccess();
175+
cy.verifyAttribute(managementEndpoint, address, samplerType, "ratio");
176+
cy.verifyAttribute(managementEndpoint, address, ratio, ratioValue);
177+
});
178+
179+
it("Reset configuration", () => {
180+
cy.navigateToGenericSubsystemPage(managementEndpoint, address);
181+
cy.get('#model-browser-resource-tab-container a[href="#model-browser-resource-data-tab"]').click();
182+
cy.resetForm(configurationFormId, managementEndpoint, address);
183+
});
184+
});

packages/testsuite/cypress/e2e/update-manager/test-configuration-update-channel.cy.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ describe("TESTS: Update Manager => Channels", () => {
115115
const isJbossEapChannelPrinted = ($items: JQuery<HTMLElement>): boolean => {
116116
for (let i = 0; i < $items.length; i++) {
117117
const text = $items[i].innerText.trim();
118-
if (text.startsWith('JBoss EAP')) {
118+
if (text.startsWith("JBoss EAP")) {
119119
return true;
120120
}
121121
}
@@ -132,11 +132,11 @@ describe("TESTS: Update Manager => Channels", () => {
132132
cy.navigateToUpdateManagerPage(managementEndpoint, ["update-manager", "updates"]);
133133

134134
// click on last printed revision (first revision in history)
135-
cy.get('#update-manager-update ul li').last().click();
135+
cy.get("#update-manager-update ul li").last().click();
136136

137137
// try to find EAP channel
138-
cy.contains('li.list-group-item', 'Channel Versions')
139-
.find('.value ul li')
138+
cy.contains("li.list-group-item", "Channel Versions")
139+
.find(".value ul li")
140140
.should(($items) => {
141141
expect(isJbossEapChannelPrinted($items), '"JBoss EAP" channel not printed').to.equal(true);
142142
});
@@ -149,8 +149,8 @@ describe("TESTS: Update Manager => Channels", () => {
149149
*/
150150
it("Check channel version in runtimes", () => {
151151
cy.navigateTo(managementEndpoint, "runtime;path=standalone-server-column~standalone-host-server");
152-
cy.get('#standalone-server-column ul li').first().click();
153-
cy.get('#channel-versions li .value').should(($items) => {
152+
cy.get("#standalone-server-column ul li").first().click();
153+
cy.get("#channel-versions li .value").should(($items) => {
154154
expect(isJbossEapChannelPrinted($items), '"JBoss EAP" channel not printed').to.equal(true);
155155
});
156156
});

packages/testsuite/cypress/support/containers-utils.ts

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
Cypress.Commands.add("startWildflyContainer", (options = { useNetworkHostMode: false }) => {
2-
return cy.task(
3-
"start:wildfly:container",
4-
{
5-
name: Cypress.spec.name.replace(/\.cy\.ts/g, "").replace(/-/g, "_"),
6-
configuration: "standalone-insecure.xml",
7-
useNetworkHostMode: options.useNetworkHostMode,
8-
},
9-
{ timeout: 240_000 },
10-
);
11-
});
1+
Cypress.Commands.add(
2+
"startWildflyContainer",
3+
(options = { useNetworkHostMode: false, configuration: "standalone-insecure.xml" }) => {
4+
return cy.task(
5+
"start:wildfly:container",
6+
{
7+
name: Cypress.spec.name.replace(/\.cy\.ts/g, "").replace(/-/g, "_"),
8+
configuration: options.configuration || "standalone-insecure.xml",
9+
useNetworkHostMode: options.useNetworkHostMode,
10+
},
11+
{ timeout: 240_000 },
12+
);
13+
},
14+
);
1215

1316
Cypress.Commands.add("startWildflyContainerSecured", () => {
1417
return cy.task(
@@ -43,9 +46,12 @@ declare global {
4346
* Start a Wildfly container. This command is executed in before method in most of the test cases/specifications.
4447
* Unsecured management interface is used and web console doesn't require any authentication.
4548
*
49+
* @param options.useNetworkHostMode - Whether to use network host mode
50+
* @param options.configuration - Configuration file to use (default: standalone-insecure.xml)
51+
*
4652
* @category Containers util
4753
*/
48-
startWildflyContainer(options?: { useNetworkHostMode?: boolean }): Chainable<unknown>;
54+
startWildflyContainer(options?: { useNetworkHostMode?: boolean; configuration?: string }): Chainable<unknown>;
4955
/**
5056
* Start a Wildfly container wich is secured. This is not for a common use.
5157
*

0 commit comments

Comments
 (0)