Skip to content

Conversation

@ebarlas
Copy link
Contributor

@ebarlas ebarlas commented Dec 21, 2025

Summary of tests targeted:

CustomRealmIT

  • Commit: abc3aab
  • Project: x-pack/qa/security-example-spi-extension
  • legacy-java-rest-testinternal-java-rest-test

AbstractPasswordToolTestCase

  • Commit: b74837d
  • Project: x-pack/qa/security-setup-password-tests
  • legacy-java-rest-testinternal-java-rest-test

SqlSecurityTestCase

  • Commit: 346eb9b
  • Project: x-pack/plugin/sql/qa/server/security
  • legacy-java-rest-testinternal-java-rest-test
  • Replaced file-based audit log reading with getCluster().getNodeLog(0, LogType.AUDIT) used elsewhere

SqlSecurityTestCase architecture diagram with relevant changes:

graph TB
    subgraph gradle [Gradle Build Files]
        parentBuild[server/build.gradle]
        securityBuild[security/build.gradle]
        withSslBuild[with-ssl/build.gradle]
        withoutSslBuild[without-ssl/build.gradle]
    end
    
    subgraph java [Java Test Classes]
        clusterConfig[SqlSecurityTestCluster]
        testCase[SqlSecurityTestCase]
        testClasses[16 *IT.java classes]
    end
    
    subgraph framework [Test Clusters Framework]
        elasticsearchCluster[ElasticsearchCluster]
        logType[LogType.AUDIT]
        resource[Resource.fromClasspath]
    end
    
    parentBuild -->|applies internal-java-rest-test| securityBuild
    securityBuild -->|testImplementation| framework
    withSslBuild -->|tests.ssl.enabled not set| clusterConfig
    withoutSslBuild -->|tests.ssl.enabled=false| clusterConfig
    
    clusterConfig -->|creates| elasticsearchCluster
    clusterConfig -->|loads roles.yml| resource
    testCase -->|uses| clusterConfig
    testCase -->|reads audit via| logType
    testClasses -->|extend| testCase
Loading

@ebarlas ebarlas added >test Issues or PRs that are addressing/adding tests :Security/Security Security issues without another label Team:Security Meta label for security team labels Dec 22, 2025
@ebarlas ebarlas marked this pull request as ready for review December 22, 2025 20:55
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-security (Team:Security)

@ebarlas ebarlas marked this pull request as draft December 26, 2025 23:47
}
} else {
apply plugin: 'elasticsearch.internal-java-rest-test'
if (project.parent.name != 'security') {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All non-security subprojects now use elasticsearch.internal-java-rest-test instead of conditionally using legacy-java-rest-test for security subprojects.

testImplementation project(':x-pack:plugin:core')
testImplementation(testArtifact(project(xpackModule('core'))))
testImplementation project(":test:framework")
testImplementation project(':test:test-clusters')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The security parent project's test classes directly import test-clusters types. Without this dependency, compiling src/test/java fails with:

error: package org.elasticsearch.test.cluster does not exist

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change replaces byte-offset file-based tracking with line-count tracking that uses the test cluster API.

This approach is used elsewhere. See x-pack/plugin/security/qa/audit/src/javaRestTest/java/org/elasticsearch/xpack/security/audit/AuditIT.java.

@ebarlas ebarlas marked this pull request as ready for review December 29, 2025 20:51
@ebarlas ebarlas merged commit e4038b1 into elastic:main Jan 5, 2026
41 checks passed
ywangd pushed a commit to ywangd/elasticsearch that referenced this pull request Jan 5, 2026
- Update x-pack/qa/security-setup-password-tests to use
  internal-java-rest-test plugin
- Update x-pack/qa/security-example-spi-extension to use
  internal-java-rest-test plugin
- Update x-pack/plugin/sql/qa/server/security to use
  internal-java-rest-test plugin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Security/Security Security issues without another label Team:Security Meta label for security team >test Issues or PRs that are addressing/adding tests v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants