diff --git a/integration_tests/dbt/smoke_test.sh b/integration_tests/dbt/smoke_test.sh index 689a11d1..3a9c502b 100755 --- a/integration_tests/dbt/smoke_test.sh +++ b/integration_tests/dbt/smoke_test.sh @@ -6,17 +6,17 @@ cd "$SCRIPT_DIR" pwd # Prepare env -# git restore models/customers.sql -# dbt --version -# dbt deps -# dbt seed --target-path target-base -# dbt run --target-path target-base -# dbt docs generate --target-path target-base - -# echo "where customer_id > 0" >> models/customers.sql -# dbt run -# dbt docs generate -# git restore models/customers.sql +git restore models/customers.sql +dbt --version +dbt deps +dbt seed --target-path target-base +dbt run --target-path target-base +dbt docs generate --target-path target-base + +echo "where customer_id > 0" >> models/customers.sql +dbt run +dbt docs generate +git restore models/customers.sql # Recce Run mkdir -p ~/.recce @@ -30,20 +30,20 @@ assert_string_value() { fi } -# recce run -# if ! [ -e recce_state.json ]; then -# echo "recce_state.json not found" -# exit 1 -# fi +recce run +if ! [ -e recce_state.json ]; then + echo "recce_state.json not found" + exit 1 +fi -# model=$(cat recce_state.json | jq '.runs[0].result | keys | .[0]' | tr -d '"') -# run_type=$(cat recce_state.json | jq '.runs[0]'.type | tr -d '"') -# assert_string_value $model "customers" -# assert_string_value $run_type "row_count_diff" +model=$(cat recce_state.json | jq '.runs[0].result | keys | .[0]' | tr -d '"') +run_type=$(cat recce_state.json | jq '.runs[0]'.type | tr -d '"') +assert_string_value $model "customers" +assert_string_value $run_type "row_count_diff" # Recce Summary -# recce summary ./recce_state.json | tee recce_summary.md -# cat ./recce_summary.md | grep -q customers +recce summary ./recce_state.json | tee recce_summary.md +cat ./recce_summary.md | grep -q customers # Recce Server function check_server_status() { @@ -63,13 +63,13 @@ function check_server_status() { echo "Server stopped." } -# echo "Starting the server..." -# recce server & -# check_server_status +echo "Starting the server..." +recce server & +check_server_status -# echo "Starting the server (review mode)..." -# recce server --review recce_state.json & -# check_server_status +echo "Starting the server (review mode)..." +recce server --review recce_state.json & +check_server_status # Clone jaffle_shop_duckdb @@ -81,15 +81,19 @@ GIT_REPO="https://github.com/DataRecce/jaffle_shop_duckdb.git" GIT_BRANCH="fix/customer-lifetime-value" git clone --depth 1 --branch $GIT_BRANCH $GIT_REPO -ls -al cd jaffle_shop_duckdb || exit -echo $GIT_DIR -echo +# Hide PR information from GitHub Action +HOLD_GITHUB_EVENT_PATH="$GITHUB_EVENT_PATH" +unset GITHUB_EVENT_PATH +# Recce Summary - Cloud recce summary --cloud | tee recce_summary.md cat ./recce_summary.md | grep -q customers +# Recce Server - Cloud echo "Starting the server (cloud and review mode)..." recce server --cloud --review & check_server_status + +export GITHUB_EVENT_PATH="$HOLD_GITHUB_EVENT_PATH" diff --git a/recce/git.py b/recce/git.py index cc59aa3d..112e45a3 100644 --- a/recce/git.py +++ b/recce/git.py @@ -67,13 +67,11 @@ def hosting_repo(remote: str = 'origin'): # Handle https://github.com/user/repo.git or http://github.com/user/repo.git remote_repo = '/'.join(origin_url.split('/')[-2:]).replace('.git', '') - print('remote', remote_repo) return remote_repo except ValueError: repo = Repo(search_parent_directories=True) toplevel_dir = repo.git.rev_parse("--show-toplevel") - print('top', toplevel_dir) return os.path.basename(toplevel_dir) except InvalidGitRepositoryError: return None