Skip to content

Commit f398df4

Browse files
authored
Add micrometer tag test (#2059)
* Add micrometer tag test * Fix smoke test debugging
1 parent cca635d commit f398df4

File tree

3 files changed

+6
-5
lines changed
  • test/smoke

3 files changed

+6
-5
lines changed

test/smoke/framework/testCore/src/main/java/com/microsoft/applicationinsights/smoketest/AiSmokeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ protected static void waitForApplicationToStart() throws Exception {
405405
} catch (Exception e) {
406406
for (ContainerInfo container : allContainers) {
407407
System.out.println("========== dumping container log: " + container.getContainerId());
408-
AiDockerClient.printContainerLogs(containerInfo.getContainerId());
408+
AiDockerClient.printContainerLogs(container.getContainerId());
409409
System.out.println("end of container log ==========");
410410
}
411411
throw e;

test/smoke/testApps/Micrometer/src/main/java/com/microsoft/applicationinsights/smoketestapp/TestController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
@RestController
3030
public class TestController {
3131

32-
private final Counter counter = Metrics.counter("test_counter");
33-
private final Counter excludedCounter = Metrics.counter("test_counter_exclude_me");
34-
private final Counter anotherExcludedCounter = Metrics.counter("exclude_me_test_counter");
32+
private final Counter counter = Metrics.counter("test.counter", "tag1", "value1");
33+
private final Counter excludedCounter = Metrics.counter("test.counter.exclude.me");
34+
private final Counter anotherExcludedCounter = Metrics.counter("exclude.me.test.counter");
3535

3636
@GetMapping("/")
3737
public String root() {

test/smoke/testApps/Micrometer/src/smokeTest/java/com/microsoft/applicationinsights/smoketest/MicrometerTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public void doMostBasicTest() throws Exception {
7777
assertNull("getMin was non-null", point.getMin());
7878
assertNull("getMax was non-null", point.getMax());
7979
assertNull("getStdDev was non-null", point.getStdDev());
80-
assertTrue(data.getProperties().isEmpty());
80+
assertEquals(1, data.getProperties().size());
81+
assertEquals("value1", data.getProperties().get("tag1"));
8182
}
8283
}

0 commit comments

Comments
 (0)