mirror of
https://github.com/tiennm99/tjahzi.git
synced 2026-10-14 00:17:02 +00:00
Re #39: Fixed unstable tests.
This commit is contained in:
1 parent
7a1d153a61
commit
89eb4db274
6 files changed
+25
-23
No files matched your search
+2
-4
@@ -68,7 +68,7 @@ class LogLevelLabelConfigurationTest {
|
||||
given()
|
||||
.contentType(ContentType.URLENC)
|
||||
.urlEncodingEnabled(false)
|
||||
.formParam("query=%7Bserver%3D%22127.0.0.1%22%7D")
|
||||
.formParam("query=%7Btest%3D%22shouldWorkWithNoLogLevelConfigured%22%7D")
|
||||
.when()
|
||||
.get("/loki/api/v1/query_range")
|
||||
.then()
|
||||
@@ -77,7 +77,6 @@ class LogLevelLabelConfigurationTest {
|
||||
.statusCode(200)
|
||||
.body("status", equalTo("success"))
|
||||
.body("data.result.size()", equalTo(1))
|
||||
.body("data.result[0].stream.server", equalTo("127.0.0.1"))
|
||||
.body("data.result[0].stream.log_level", nullValue());
|
||||
});
|
||||
}
|
||||
@@ -114,7 +113,7 @@ class LogLevelLabelConfigurationTest {
|
||||
given()
|
||||
.contentType(ContentType.URLENC)
|
||||
.urlEncodingEnabled(false)
|
||||
.formParam("query=%7Bserver%3D%22127.0.0.1%22%7D")
|
||||
.formParam("query=%7Btest%3D%22shouldSendLogLevelAsConfigured%22%7D")
|
||||
.when()
|
||||
.get("/loki/api/v1/query_range")
|
||||
.then()
|
||||
@@ -123,7 +122,6 @@ class LogLevelLabelConfigurationTest {
|
||||
.statusCode(200)
|
||||
.body("status", equalTo("success"))
|
||||
.body("data.result.size()", equalTo(1))
|
||||
.body("data.result[0].stream.server", equalTo("127.0.0.1"))
|
||||
.body("data.result[0].stream.log_level", equalTo("INFO"));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</PatternLayout>
|
||||
|
||||
<Header name="server" value="127.0.0.1"/>
|
||||
<Label name="server" value="127.0.0.1"/>
|
||||
<Label name="test" value="shouldSendLogLevelAsConfigured"/>
|
||||
</Loki>
|
||||
</appenders>
|
||||
</configuration>
|
||||
@@ -20,7 +20,7 @@
|
||||
</PatternLayout>
|
||||
|
||||
<Header name="server" value="127.0.0.1"/>
|
||||
<Label name="server" value="127.0.0.1"/>
|
||||
<Label name="test" value="shouldWorkWithNoLogLevelConfigured"/>
|
||||
</Loki>
|
||||
</appenders>
|
||||
</configuration>
|
||||
+6
-8
@@ -39,7 +39,7 @@ class LogLevelLabelConfigurationTest {
|
||||
.withExposedPorts(3100);
|
||||
|
||||
@Test
|
||||
void shouldWorkWIthNoLogLevelConfigured() throws Exception {
|
||||
void shouldWorkWithNoLogLevelConfigured() throws Exception {
|
||||
// Given
|
||||
System.setProperty("loki.host", loki.getHost());
|
||||
System.setProperty("loki.port", loki.getFirstMappedPort().toString());
|
||||
@@ -58,7 +58,7 @@ class LogLevelLabelConfigurationTest {
|
||||
configurator.doConfigure(uri.toURL());
|
||||
|
||||
// When
|
||||
Logger logger = context.getLogger(LokiAppenderLargeBatchesTest.class);
|
||||
Logger logger = context.getLogger(LogLevelLabelConfigurationTest.class);
|
||||
logger.info("Test");
|
||||
|
||||
// Then
|
||||
@@ -75,7 +75,7 @@ class LogLevelLabelConfigurationTest {
|
||||
given()
|
||||
.contentType(ContentType.URLENC)
|
||||
.urlEncodingEnabled(false)
|
||||
.formParam("query=%7Bserver%3D%22127.0.0.1%22%7D")
|
||||
.formParam("query=%7Btest%3D%22shouldWorkWithNoLogLevelConfigured%22%7D")
|
||||
.when()
|
||||
.get("/loki/api/v1/query_range")
|
||||
.then()
|
||||
@@ -84,7 +84,6 @@ class LogLevelLabelConfigurationTest {
|
||||
.statusCode(200)
|
||||
.body("status", equalTo("success"))
|
||||
.body("data.result.size()", equalTo(1))
|
||||
.body("data.result[0].stream.server", equalTo("127.0.0.1"))
|
||||
.body("data.result[0].stream.log_level", nullValue());
|
||||
});
|
||||
}
|
||||
@@ -109,7 +108,7 @@ class LogLevelLabelConfigurationTest {
|
||||
configurator.doConfigure(uri.toURL());
|
||||
|
||||
// When
|
||||
Logger logger = context.getLogger(LokiAppenderLargeBatchesTest.class);
|
||||
Logger logger = context.getLogger(LogLevelLabelConfigurationTest.class);
|
||||
logger.info("Test");
|
||||
|
||||
// Then
|
||||
@@ -126,7 +125,7 @@ class LogLevelLabelConfigurationTest {
|
||||
given()
|
||||
.contentType(ContentType.URLENC)
|
||||
.urlEncodingEnabled(false)
|
||||
.formParam("query=%7Bserver%3D%22127.0.0.1%22%7D")
|
||||
.formParam("query=%7Btest%3D%22shouldSendLogLevelAsConfigured%22%7D")
|
||||
.when()
|
||||
.get("/loki/api/v1/query_range")
|
||||
.then()
|
||||
@@ -134,8 +133,7 @@ class LogLevelLabelConfigurationTest {
|
||||
.all()
|
||||
.statusCode(200)
|
||||
.body("status", equalTo("success"))
|
||||
.body("data.result.size()", greaterThanOrEqualTo(1))
|
||||
.body("data.result[0].stream.server", equalTo("127.0.0.1"))
|
||||
.body("data.result.size()", equalTo(1))
|
||||
.body("data.result[0].stream.log_level", equalTo("INFO"));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,17 +12,20 @@
|
||||
<value>Circus</value>
|
||||
</header>
|
||||
|
||||
<label>
|
||||
<name>server</name>
|
||||
<value>127.0.0.1</value>
|
||||
</label>
|
||||
|
||||
<logLevelLabel>
|
||||
log_level
|
||||
</logLevelLabel>
|
||||
|
||||
<label>
|
||||
<name>test</name>
|
||||
<value>shouldSendLogLevelAsConfigured</value>
|
||||
</label>
|
||||
</appender>
|
||||
|
||||
<root level="debug">
|
||||
<logger name="pl.tkowalcz">
|
||||
<appender-ref ref="Loki"/>
|
||||
</logger>
|
||||
|
||||
<root level="debug">
|
||||
</root>
|
||||
</configuration>
|
||||
@@ -13,12 +13,15 @@
|
||||
</header>
|
||||
|
||||
<label>
|
||||
<name>server</name>
|
||||
<value>127.0.0.1</value>
|
||||
<name>test</name>
|
||||
<value>shouldWorkWithNoLogLevelConfigured</value>
|
||||
</label>
|
||||
</appender>
|
||||
|
||||
<root level="debug">
|
||||
<logger name="pl.tkowalcz">
|
||||
<appender-ref ref="Loki"/>
|
||||
</logger>
|
||||
|
||||
<root level="debug">
|
||||
</root>
|
||||
</configuration>
|
||||
Reference in new issue
Block a user