Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[native] Using setupNativeSidecarPlugin in tests outside presto-native-sidecar-plugin #24422

Open
pramodsatya opened this issue Jan 23, 2025 · 0 comments
Labels

Comments

@pramodsatya
Copy link
Contributor

Helper function setupNativeSidecarPlugin in presto-native-sidecar-plugin/src/test/java/com/facebook/presto/sidecar/NativeSidecarPluginQueryRunnerUtils.java enables user to install the native sidecar plugin on the QueryRunner used for tests. This function is currently only used in the module presto-native-sidecar-plugin; attempting to use this function in a different module (presto-native-tests in this case) results in the following error:

java.lang.NoClassDefFoundError: com/facebook/presto/sidecar/NativeSidecarPlugin
	at com.facebook.presto.sidecar.NativeSidecarPluginQueryRunnerUtils.setupNativeSidecarPlugin(NativeSidecarPluginQueryRunnerUtils.java:24)
	at com.facebook.presto.nativetests.TestRepartitionQueriesWithSmallPages.createQueryRunner(TestRepartitionQueriesWithSmallPages.java:38)
...

Dependency in module's pom.xml (presto-native-tests/pom.xml in this case):

        <dependency>
            <groupId>com.facebook.presto</groupId>
            <artifactId>presto-native-sidecar-plugin</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
            <type>test-jar</type>
        </dependency>

This error came up while trying to add the native sidecar coordinator plugin to native query runner for running tests in presto-native-tests.
Having a dependency on presto-native-sidecar-plugin with two different scopes, test (to access NativeSidecarPluginQueryRunnerUtils.setupNativeSidecarPlugin) and compile (to access NativeSidecarPlugin), appears to resolve the error. However this change throws an error with maven-checks Github action:

presto % ./mvnw install -B -V -T 1C -DskipTests -Dmaven.javadoc.skip=true --no-transfer-progress -P ci -pl '!presto-test-coverage,!:presto-docs'
...
...
[INFO] --- maven-dependency-plugin:3.1.1:analyze-only (default) @ presto-native-tests ---
[WARNING] Unused declared dependencies found:
[WARNING]    com.facebook.presto:presto-native-sidecar-plugin:jar:0.291-SNAPSHOT:compile
...
...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.1:analyze-only (default) on project presto-native-tests: Dependency problems found -> [Help 1]

Not sure if this is the right fix, or whether the function setupNativeSidecarPlugin needs to be modified. Opening this issue to discuss a potential fix for this error.

cc: @aditi-pandit @tdcmeehan @pdabre12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🆕 Unprioritized
Development

No branches or pull requests

1 participant