|
| 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 | +}); |
0 commit comments