Skip to content

Commit

Permalink
allow configurable artifacts directory in e2e testing
Browse files Browse the repository at this point in the history
Signed-off-by: Jose R. Gonzalez <jose@flutes.dev>
  • Loading branch information
komish authored and acornett21 committed Jan 5, 2023
1 parent 174eea6 commit bdbb21e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ sgol.txt

# Testing dirs
/artifacts
# E2E customized env artifacts dir
stcafitra/
# E2E testing artifacts dir
e2e_test_artifacts/

# But we don't want to ignore the artifacts package
!/certification/artifacts
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/operator-test-customized-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ OPERATOR_INDEXIMAGE=${OPERATOR_INDEXIMAGE:-"$DEFAULT_OPERATOR_INDEXIMAGE"}
customized_sa="customsa" \
customized_ns="customns" \
customized_logfile="sgol.txt" \
customized_artifacts="stcafitra" \
customized_artifacts="e2e_test_artifacts" \
results_file="./${customized_artifacts}/results.json"


Expand Down
8 changes: 5 additions & 3 deletions test/e2e/operator-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ set -e
DEFAULT_PREFLIGHT_BIN="preflight"
DEFAULT_OPERATOR_BUNDLE="quay.io/opdev/simple-demo-operator-bundle:latest"
DEFAULT_OPERATOR_INDEXIMAGE="quay.io/opdev/simple-demo-operator-catalog:latest"
DEFAULT_ARTIFACTS_DIR="e2e_test_artifacts"

PREFLIGHT_BIN=${PREFLIGHT_BIN:-"$DEFAULT_PREFLIGHT_BIN"}
OPERATOR_BUNDLE=${OPERATOR_BUNDLE:-"$DEFAULT_OPERATOR_BUNDLE"}
OPERATOR_INDEXIMAGE=${OPERATOR_INDEXIMAGE:-"$DEFAULT_OPERATOR_INDEXIMAGE"}
ARTIFACTS_DIR=${ARTIFACTS_DIR:-"$DEFAULT_ARTIFACTS_DIR"}

results_file="./artifacts/results.json"

results_file="${ARTIFACTS_DIR}/results.json"

USAGE="
Usage:
Expand Down Expand Up @@ -45,11 +46,12 @@ results_file="./artifacts/results.json"
echo "Preflight binary value: $PREFLIGHT_BIN"
echo "Operator bundle being tested: $OPERATOR_BUNDLE"
echo "Operator index for test: $OPERATOR_INDEXIMAGE"
echo "Artifacts directory for test: $ARTIFACTS_DIR"

# Run preflight.
echo "Running preflight"
echo -e "========================"
PFLT_LOGLEVEL=trace PFLT_INDEXIMAGE="${OPERATOR_INDEXIMAGE}" \
PFLT_LOGLEVEL=trace PFLT_INDEXIMAGE="${OPERATOR_INDEXIMAGE}" PFLT_ARTIFACTS="${ARTIFACTS_DIR}" \
"./${PREFLIGHT_BIN}" check operator "${OPERATOR_BUNDLE}"

echo -e "\n========================"
Expand Down

0 comments on commit bdbb21e

Please sign in to comment.