Skip to content

Commit

Permalink
Merge pull request #21493 from riyafa/fix-test
Browse files Browse the repository at this point in the history
Fix MetricsTestCase broken by jballerina migration
  • Loading branch information
riyafa authored Mar 5, 2020
2 parents f32b81b + ae86e8c commit e4643c3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,15 @@ static void emitStartObservationInvocation(MethodVisitor mv, int strandIndex, St
}

private static String cleanUpServiceName(String serviceName) {

String finalString = serviceName;
if (serviceName.contains("$$service$")) {
finalString = serviceName.replace("$$service$", "_");
final String serviceIdentifier = "$$service$";
if (serviceName.contains(serviceIdentifier)) {
if (serviceName.contains("$anonService$")) {
return serviceName.replace(serviceIdentifier, "_");
} else {
return serviceName.substring(0, serviceName.lastIndexOf(serviceIdentifier));
}
}
return finalString;
return serviceName;
}

static String getFullQualifiedRemoteFunctionName(String moduleOrg, String moduleName, String funcName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private void setup() throws Exception {
addMetrics();
}

@Test (groups = "brokenOnJBallerina")
@Test
public void testMetrics() throws Exception {
// Test Service
await().atMost(20, TimeUnit.SECONDS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,6 @@

<test name="ballerina-observability-tests" parallel="false">
<parameter name="enableJBallerinaTests" value="true"/>
<groups>
<run>
<exclude name="brokenOnJBallerina"/>
</run>
</groups>
<classes>
<class name="org.ballerinalang.test.observability.tracing.TracingTestCase"/>
<class name="org.ballerinalang.test.observability.metrics.MetricsTestCase"/>
Expand Down

0 comments on commit e4643c3

Please sign in to comment.