From 14085178f573556c3363f4f210d6283d750817c2 Mon Sep 17 00:00:00 2001 From: Nils Bandener Date: Tue, 2 Jul 2024 09:31:36 +0200 Subject: [PATCH] Perf test: Disable jacoco Signed-off-by: Nils Bandener --- build.gradle | 1 + .../PrivilegesEvaluatorPeformanceTest2.java | 18 +++++------------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index 218c43f9ba..39abb402c3 100644 --- a/build.gradle +++ b/build.gradle @@ -613,6 +613,7 @@ dependencies { implementation 'com.nimbusds:nimbus-jose-jwt:9.40' implementation 'com.rfksystems:blake2b:2.0.0' implementation 'com.password4j:password4j:1.8.2' + //JWT implementation "io.jsonwebtoken:jjwt-api:${jjwt_version}" implementation "io.jsonwebtoken:jjwt-impl:${jjwt_version}" diff --git a/src/performanceTest/java/org/opensearch/security/privileges/PrivilegesEvaluatorPeformanceTest2.java b/src/performanceTest/java/org/opensearch/security/privileges/PrivilegesEvaluatorPeformanceTest2.java index b7326bba41..c09689970f 100644 --- a/src/performanceTest/java/org/opensearch/security/privileges/PrivilegesEvaluatorPeformanceTest2.java +++ b/src/performanceTest/java/org/opensearch/security/privileges/PrivilegesEvaluatorPeformanceTest2.java @@ -498,22 +498,17 @@ public void run() { } final void single(PrivilegesEvaluator subject) { - try { - PrivilegesEvaluationContext context = subject.createContext( - user(user), + + PrivilegesEvaluatorResponse response = subject.evaluate(user(user), requestParameters.action, requestParameters.getRequest(this.random), null, - null - ); - PrivilegesEvaluatorResponse response = subject.evaluate(context); + null); if (!response.isAllowed()) { throw new RuntimeException("Assertion failed: " + response); } - } catch (PrivilegesEvaluatorResponse.NotAllowedException e) { - throw new RuntimeException(e); - } + } } @@ -587,10 +582,7 @@ public ReplaceResult replaceDashboardsIndex( indexResolverReplacer, namedXContentRegistry ); - privilegesEvaluator.updateConfiguration( - TEST_SECURITY_CONFIG.geActionGroupsConfiguration(), - TEST_SECURITY_CONFIG.getRolesConfiguration() - ); + privilegesEvaluator.onDynamicConfigModelChanged(dynamicConfigModel); privilegesEvaluator.onConfigModelChanged(configModel);