Skip to content
Open
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
25 changes: 25 additions & 0 deletions tests/integration/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Derive Spark component versions used by integration tests.
# Allows overrides via environment variables while defaulting
# to the version recorded in the repository SPARK_VERSION file.

SPARK_VERSION_FILE=${SPARK_VERSION_FILE:-"./SPARK_VERSION"}

if [ ! -f "${SPARK_VERSION_FILE}" ]; then
echo "ERROR: Spark version file not found at ${SPARK_VERSION_FILE}." >&2
exit 1
fi

SPARK_VERSION_CONTENT=$(tr -d ' \n' < "${SPARK_VERSION_FILE}")
SPARK_RELEASE_VERSION=${SPARK_VERSION_CONTENT%%-*}
SPARK_MAJOR_MINOR=$(echo "${SPARK_RELEASE_VERSION}" | cut -d'.' -f1-2)

DEFAULT_SPARK_IMAGE="ghcr.io/canonical/charmed-spark:${SPARK_MAJOR_MINOR}-22.04_edge"
DEFAULT_SPARK_EXAMPLES_JAR_NAME="spark-examples_2.12-${SPARK_RELEASE_VERSION}.jar"

export INTEGRATION_SPARK_VERSION="${SPARK_VERSION_CONTENT}"
export INTEGRATION_SPARK_RELEASE_VERSION="${SPARK_RELEASE_VERSION}"
export INTEGRATION_SPARK_MAJOR_MINOR_VERSION="${SPARK_MAJOR_MINOR}"
export INTEGRATION_SPARK_IMAGE="${SPARK_IMAGE:-${DEFAULT_SPARK_IMAGE}}"
export INTEGRATION_SPARK_EXAMPLES_JAR_NAME="${SPARK_EXAMPLES_JAR_NAME:-${DEFAULT_SPARK_EXAMPLES_JAR_NAME}}"
6 changes: 4 additions & 2 deletions tests/integration/ie-tests-tls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

# Copyright 2025 Canonical Ltd.

readonly SPARK_IMAGE='ghcr.io/canonical/charmed-spark:3.5-22.04_edge'
readonly SPARK_EXAMPLES_JAR_NAME='spark-examples_2.12-3.5.5.jar'
source ./tests/integration/common.sh

readonly SPARK_IMAGE="${INTEGRATION_SPARK_IMAGE}"
readonly SPARK_EXAMPLES_JAR_NAME="${INTEGRATION_SPARK_EXAMPLES_JAR_NAME}"

S3_BUCKET=test-snap-$(uuidgen)
SERVICE_ACCOUNT=spark
Expand Down
5 changes: 3 additions & 2 deletions tests/integration/ie-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
# Copyright 2024 Canonical Ltd.

# Import reusable utilities
source ./tests/integration/common.sh
source ./tests/integration/utils/s3-utils.sh
source ./tests/integration/utils/azure-utils.sh


readonly SPARK_IMAGE='ghcr.io/canonical/charmed-spark:3.5-22.04_edge'
readonly SPARK_EXAMPLES_JAR_NAME='spark-examples_2.12-3.5.5.jar'
readonly SPARK_IMAGE="${INTEGRATION_SPARK_IMAGE}"
readonly SPARK_EXAMPLES_JAR_NAME="${INTEGRATION_SPARK_EXAMPLES_JAR_NAME}"

S3_BUCKET=test-snap-$(uuidgen)
SERVICE_ACCOUNT=spark
Expand Down
Loading