Skip to content

Commit

Permalink
Update required env variable
Browse files Browse the repository at this point in the history
Signed-off-by: Wei-Chun, Chang <wcchang@infuseai.io>
  • Loading branch information
wcchang1115 committed Dec 18, 2024
1 parent ddbfa91 commit 4406a2e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 32 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ jobs:
run: |
./integration_tests/dbt/smoke_test.sh
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.RECCE_CLOUD_TOKEN }}
RECCE_STATE_PASSWORD: ${{ vars.RECCE_STATE_PASSWORD}}
72 changes: 41 additions & 31 deletions integration_tests/dbt/smoke_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {
Expand All @@ -63,23 +63,33 @@ 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


# Recce Cloud
# Clone jaffle_shop_duckdb
NEW_WORKSPACE=$(dirname "$GITHUB_WORKSPACE")
cd "$NEW_WORKSPACE" || exit
pwd

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
cd jaffle_shop_duckdb || exit
pwd
ls -al
cd jaffle_shop_duckdb || exit

echo $GIT_DIR
echo

recce summary --cloud | tee recce_summary.md
cat ./recce_summary.md | grep -q customers

echo "Starting the server (cloud and review mode)..."
recce server --cloud --review &
check_server_status
2 changes: 2 additions & 0 deletions recce/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ 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

0 comments on commit 4406a2e

Please sign in to comment.