Skip to content

Commit

Permalink
Convert main integration tests into reusable backbox tests
Browse files Browse the repository at this point in the history
* Introduce new module: `integration-tests` to contain the test
  code for backbox integration tests

* Refactors existing main integration tests to avoid relying on
  Dropwizard internals.

* Add new test extension for managing the test environment with
  custom server managers discovered via `ServiceLoader`

* Use Dropwizard test extentions for the reference implementation
  of `PolarisServerManager`. Custom server builds can provide
  their own environment-specific implementations.

* Add helper classes for REST API (Management and Catalog)

* Run reusable tests by extending them in the DW module.
  Using test suites is also possible, but it only uses one
  gradle test worker, so test parallelism is reduced. At the
  same time running tests in parallel withing the same JVM using
  JUnit5 threads currently leads to errors.
  • Loading branch information
dimas-b committed Jan 8, 2025
1 parent 0e8731c commit 07b6a08
Show file tree
Hide file tree
Showing 34 changed files with 2,058 additions and 1,661 deletions.
3 changes: 3 additions & 0 deletions dropwizard/service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ dependencies {
compileOnly(libs.jakarta.annotation.api)
compileOnly(libs.spotbugs.annotations)

testImplementation(project(":polaris-tests"))
testImplementation(project(":polaris-api-management-model"))

testImplementation("org.apache.iceberg:iceberg-api:${libs.versions.iceberg.get()}:tests")
Expand Down Expand Up @@ -140,6 +141,8 @@ tasks.named<Test>("test").configure {
if (System.getenv("AWS_REGION") == null) {
environment("AWS_REGION", "us-west-2")
}
environment("POLARIS_BOOTSTRAP_POLARIS_ROOT_CLIENT_ID", "test-admin")
environment("POLARIS_BOOTSTRAP_POLARIS_ROOT_CLIENT_SECRET", "test-secret")
jvmArgs("--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED")
useJUnitPlatform()
maxParallelForks = 4
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.polaris.service.dropwizard.it;

import org.apache.polaris.service.it.test.PolarisApplicationIntegrationTest;

public class DropwizardApplicationIntegrationTest extends PolarisApplicationIntegrationTest {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.polaris.service.dropwizard.it;

import org.apache.polaris.service.it.test.PolarisManagementServiceIntegrationTest;

public class DropwizardManagementServiceIntegrationTest
extends PolarisManagementServiceIntegrationTest {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.polaris.service.dropwizard.it;

import org.apache.polaris.service.it.test.PolarisRestCatalogIntegrationTest;

public class DropwizardRestCatalogIntegrationTest extends PolarisRestCatalogIntegrationTest {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.polaris.service.dropwizard.it;

import org.apache.polaris.service.it.test.PolarisRestCatalogViewAwsIntegrationTest;

public class DropwizardRestCatalogViewAwsIntegrationTest
extends PolarisRestCatalogViewAwsIntegrationTest {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.polaris.service.dropwizard.it;

import org.apache.polaris.service.it.test.PolarisRestCatalogViewAzureIntegrationTest;

public class DropwizardRestCatalogViewAzureIntegrationTest
extends PolarisRestCatalogViewAzureIntegrationTest {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.polaris.service.dropwizard.it;

import org.apache.polaris.service.it.test.PolarisRestCatalogViewFileIntegrationTest;

public class DropwizardRestCatalogViewFileIntegrationTest
extends PolarisRestCatalogViewFileIntegrationTest {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.polaris.service.dropwizard.it;

import org.apache.polaris.service.it.test.PolarisRestCatalogViewGcpIntegrationTest;

public class DropwizardRestCatalogViewGcpIntegrationTest
extends PolarisRestCatalogViewGcpIntegrationTest {}
Loading

0 comments on commit 07b6a08

Please sign in to comment.