Skip to content

Port Clojure tests to Java: metrics_test, nimbus_auth_test (Phase 5)#8450

Merged
jnioche merged 1 commit intomasterfrom
port/clojure-tests-phase5
Mar 30, 2026
Merged

Port Clojure tests to Java: metrics_test, nimbus_auth_test (Phase 5)#8450
jnioche merged 1 commit intomasterfrom
port/clojure-tests-phase5

Conversation

@jnioche
Copy link
Copy Markdown
Contributor

@jnioche jnioche commented Mar 28, 2026

Summary

  • Ports 2 of 5 tests from metrics_test.clj and all 5 tests from nimbus_auth_test.clj to Java/JUnit 5
  • Clojure defbolt count-acks replaced with Java CountAcksBolt inner class
  • JAAS digest config copied to storm-server test resources for classpath access

Tests ported

MetricsIntegrationTest (storm-core, 2 tests):

Test Coverage
testCustomMetric CountMetric with FakeMetricConsumer, simulated time
testCustomMetricWithMultiTasks Same with 2 tasks per bolt (all grouping)

Skipped: 3 Python multilang metrics tests (require Python shell bolt/spout)

NimbusAuthTest (storm-server, 5 tests):

Test Coverage
testSimpleAuthentication SimpleTransportPlugin with no authorizer
testNoopAuthorizationWithSimpleTransport NoopAuthorizer, mocked cluster state
testDenyAuthorizationWithSimpleTransport DenyAuthorizer, 17 denied Nimbus operations
testNoopAuthorizationWithSaslDigest DigestSaslTransportPlugin with JAAS config
testDenyAuthorizationWithSaslDigest DenyAuthorizer with SASL digest, 17 denied ops

Part of the Clojure test migration effort (Phase 5 of #8445).

Test plan

  • mvn test -pl storm-core -Dtest=org.apache.storm.metric.MetricsIntegrationTest — 2 tests pass
  • mvn test -pl storm-server -Dtest=org.apache.storm.security.auth.NimbusAuthTest — 5 tests pass
  • Verify existing tests still pass

🤖 Generated with Claude Code

Port 2 tests from storm-core/test/clj/org/apache/storm/metrics_test.clj to
storm-core/test/jvm/org/apache/storm/metric/MetricsIntegrationTest.java:
- testCustomMetric: CountMetric with FakeMetricConsumer, simulated time
- testCustomMetricWithMultiTasks: same with 2 tasks per bolt

Skipped 2 Python multilang metrics tests (require Python shell components)
and 1 spout multilang test.

Port 5 tests from storm-core/test/clj/org/apache/storm/security/auth/nimbus_auth_test.clj to
storm-server/src/test/java/org/apache/storm/security/auth/NimbusAuthTest.java:
- testSimpleAuthentication: SimpleTransportPlugin with no authorizer
- testNoopAuthorizationWithSimpleTransport: NoopAuthorizer, mocked cluster state
- testDenyAuthorizationWithSimpleTransport: DenyAuthorizer, 17 denied operations
- testNoopAuthorizationWithSaslDigest: DigestSaslTransportPlugin with JAAS
- testDenyAuthorizationWithSaslDigest: DenyAuthorizer with SASL, 17 denied ops

JAAS config file copied to storm-server test resources for classpath access.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jnioche jnioche merged commit ca4506d into master Mar 30, 2026
10 checks passed
@jnioche jnioche deleted the port/clojure-tests-phase5 branch March 30, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants