Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/integration_tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use iceberg_test_utils::{normalize_test_name, set_up};
const REST_CATALOG_PORT: u16 = 8181;

pub struct TestFixture {
pub _docker_compose: DockerCompose,
pub docker_compose: DockerCompose,
pub catalog_config: RestCatalogConfig,
}

Expand Down Expand Up @@ -57,7 +57,7 @@ pub fn set_test_fixture(func: &str) -> TestFixture {
.build();

TestFixture {
_docker_compose: docker_compose,
docker_compose,
catalog_config,
}
}
1 change: 1 addition & 0 deletions crates/integration_tests/testdata/spark/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ WORKDIR '/home/'

COPY entrypoint.sh .
COPY provision.py .
COPY validation.py .

HEALTHCHECK --retries=120 --interval=1s \
CMD ls /tmp/ready || exit 1
Expand Down
28 changes: 28 additions & 0 deletions crates/integration_tests/testdata/spark/validation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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.

import argparse
from pyspark.sql import SparkSession

spark = SparkSession.builder.getOrCreate()

if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--sql", type=str, required=True, help="query to run")
args = parser.parse_args()

spark.sql(args.sql).show(truncate=False)
2 changes: 1 addition & 1 deletion crates/integration_tests/tests/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ pub fn get_shared_containers() -> &'static Arc<TestFixture> {
#[dtor]
fn shutdown() {
if let Some(fixture) = DOCKER_CONTAINERS.get() {
fixture._docker_compose.down()
fixture.docker_compose.down()
}
}
1 change: 1 addition & 0 deletions crates/integration_tests/tests/shared_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ mod datafusion;
mod read_evolved_schema;
mod read_positional_deletes;
mod scan_all_type;
mod spark;

pub async fn random_ns() -> Namespace {
let fixture = get_shared_containers();
Expand Down
Loading
Loading