-
Notifications
You must be signed in to change notification settings - Fork 53
Add proper tests for Spark images #154
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,6 +61,16 @@ function check_gpdb() { | |
| environment_compose exec gpdb su gpadmin -l -c "pg_isready" | ||
| } | ||
|
|
||
| function check_spark() { | ||
| environment_compose exec spark curl -f http://localhost:10213 | ||
| } | ||
|
|
||
| function run_spark_tests() { | ||
| environment_compose exec spark beeline -u jdbc:hive2://localhost:10213 -e 'SELECT 1;' && | ||
| environment_compose exec spark beeline -u jdbc:hive2://localhost:10213 -e 'SHOW DATABASES;' && | ||
| true | ||
| } | ||
|
|
||
| function check_health() { | ||
| local service=$1 | ||
| test "$(environment_compose ps --format json | jq -er --arg name "$service" '.[] | select(.Service == $name) | .Health')" == "healthy" | ||
|
|
@@ -200,7 +210,14 @@ for ARCH in "${platforms[@]}"; do | |
| elif [[ ${ENVIRONMENT} == *"openldap"* ]]; then | ||
| retry check_openldap | ||
| elif [[ ${ENVIRONMENT} == *"spark"* ]]; then | ||
| retry check_health spark | ||
| # wait until Spark is started | ||
| retry check_spark | ||
|
|
||
| # run tests | ||
| set -x | ||
| set +e | ||
| sleep 10 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is sleep necessary? Add a comment? Also what about
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sleep is probably not needed - I just copied surrounding code.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about other iterations in the loop?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's set inside loop but after all branches. Sorry I said "outside loop". |
||
| run_spark_tests | ||
hashhar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| else | ||
| echo >&2 "ERROR: no test defined for ${ENVIRONMENT}" | ||
| cleanup | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.