Skip to content

Commit

Permalink
[pytest] Add warning for PRs missing unit test file changes
Browse files Browse the repository at this point in the history
  • Loading branch information
agl29 committed Nov 13, 2024
1 parent 7b54217 commit a4113bf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/commitflow-py3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,24 @@ jobs:
name: test-reports-${{ matrix.python-version }}
path: test-reports

- name: Check and comment if no unit test files are modified
if: matrix.python-version == '3.11'
run: |
git fetch origin master
changed_files=$(git diff --name-only origin/master)
if echo "$changed_files" | grep -qE '(^test|_test\.py|^tests|_tests\.py|.test)'; then
echo "✅ Unit test files were modified."
else
echo "⚠️ No unit test files modified."
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"body":"⚠️ No unit test files modified. Please ensure that changes are properly tested. ⚠️"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
fi
- name: run python lints
run: |
PYTHONWARNINGS=always ./build/env/bin/hue runruff check
Expand Down
7 changes: 7 additions & 0 deletions desktop/libs/notebook/src/notebook/connectors/trino.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,13 @@ def close_statement(self, notebook, snippet):
return {'status': 0}

def close_session(self, session):
catalogs = self._show_catalogs()
databases = []

for catalog in catalogs:
query_client = TrinoQuery(self.trino_request, 'SHOW SCHEMAS FROM ' + catalog)
response = query_client.execute()
databases += [f'{catalog}.{item}' for sublist in response.rows for item in sublist]
# Avoid closing session on page refresh or editor close for now
pass

Expand Down

0 comments on commit a4113bf

Please sign in to comment.