| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Adds integration tests covering: - Workbooks CRUD (create, publish, get, update, download, delete) - Datasources CRUD (publish, get, update connections, refresh, delete) - Views export (PDF, PNG, CSV, Excel) - Tag quoting (spaces and commas in tag names) - Projects get_by_path - Pagination (Pager and QuerySet, order_by, pagesize) - Jobs and async operations (trigger refresh, poll until complete) - Projects admin CRUD and permissions (SiteAdmin) - Users and groups (SiteAdmin) - Workbook permissions (grant, verify, revoke) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move default_project, project_id, and server_admin into conftest.py so individual test files don't each inline the same TABLEAU_PROJECT env var lookup. Saves ~130 lines of boilerplate across 5 files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- tagging: guard finally delete_tags with try/except (tag already deleted by test body) - jobs: skip on 403180 when workbook has no extract and refresh is disallowed - workbooks: improve filter assertion error message; use QuerySet filter instead of get() - conftest: add TABLEAU_VERIFY_SSL env var to skip SSL verification for on-prem servers Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rkbook asset Restores content from old jac/e2e-tests branch (commit cf59ca4): - test_favorites.py: workbook/view/datasource favorites - test_metadata.py: GraphQL metadata API queries - test_site_admin.py: schedules, webhooks, connection update, data freshness, workbook move, user/group management (requires e2e_admin marker) - assets/WorkbookWithExtract.twbx: binary asset for extract refresh tests - test_jobs.py: add extract_workbook fixture and test_extract_workbook_refresh_completes - test_workbooks_crud.py: add test_workbook_populate_preview_image Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sorry, something went wrong.
…urce tests SampleDS.tds is a live connection to postgres91.test.tsi.lan which Tableau Server tries to validate on publish, causing the fixture to fail if the host is unreachable. WorldIndicators.tdsx is an extract-based datasource that publishes without a connection check. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude code report: Code ReviewReviewed the diff via gh pr diff 1823. Overview: adds ~1,650 lines of e2e tests across 10 functional areas (workbooks CRUD, datasources CRUD, views export, pagination, jobs, tagging expansion, projects admin, favorites, metadata GraphQL, site-admin), plus binary fixture assets and conftest.py consolidation (server_admin, default_project, project_id fixtures, new e2e_admin marker). Solid, well-organized addition to test_e2e/, which is correctly excluded from the default pytest test -n auto run. Blocking: will fail CI black check
Suggestions (non-blocking)
Other notes
🤖 Generated with Claude Code |
Sorry, something went wrong.
|
@jacalata overall this looks good. Take a look at the issues Claude noted to see if any are worth fixing/improving. |
Sorry, something went wrong.
- Reformat single-line `if` in test_views_export.py's a_view fixture so black --check passes CI (was blocking meta-checks.yml). - Use conftest.default_project in test_workbook_permissions.workbook_and_user, eliminating 10 lines of duplicated project-lookup logic. - Replace bare `except Exception: pass` in teardown blocks with warnings.warn(...) for consistency with test_pagination.py's workbook cleanup. - Use bare Path for SAMPLE_DATASOURCE calls across test_favorites.py and test_jobs.py (was inconsistently wrapped in str()). - Register the e2e_admin marker in pyproject.toml so it matches conftest.py's pytest_configure. All from bcantoni's review comment on #1823. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Thanks — fixes applied in 3a4fe13:
Skipped Claude's suggestion to also touch test_workbook_permissions.py:149 — that one's a test-body finally, not a fixture teardown. |
Sorry, something went wrong.
There was a problem hiding this comment.
Note
Copilot was unable to run its full agentic suite in this review.
Adds a comprehensive end-to-end (E2E) pytest suite that exercises Tableau Server Client (TSC) APIs against a real Tableau server, including a separate set of SiteAdmin-only tests.
Changes:
Copilot reviewed 15 out of 17 changed files in this pull request and generated 6 comments.
Show a summary per file| File | Description |
|---|---|
| test_e2e/conftest.py | Adds admin-auth session fixture, shared project selection, and SSL verify configuration for E2E runs. |
| test_e2e/test_workbooks_crud.py | New workbook CRUD E2E coverage (publish/get/update/populate/download/delete). |
| test_e2e/test_workbook_permissions.py | New workbook/view permissions E2E coverage using SiteAdmin credentials. |
| test_e2e/test_views_export.py | New view export E2E coverage (PDF/PNG/CSV). |
| test_e2e/test_users_groups.py | New SiteAdmin E2E coverage for user/group lifecycle and membership operations. |
| test_e2e/test_tagging.py | Updates tagging tests; adds datasource tagging and more tag edge-case coverage. |
| test_e2e/test_site_admin.py | New SiteAdmin E2E coverage for schedules, webhooks, connection updates, freshness policy, project moves, and groups. |
| test_e2e/test_projects_get_by_path.py | New E2E/admin split tests for projects.get_by_path() behavior. |
| test_e2e/test_projects_admin.py | New SiteAdmin project CRUD + default permissions E2E coverage. |
| test_e2e/test_pagination.py | New E2E coverage for TSC.Pager and QuerySet pagination behavior. |
| test_e2e/test_metadata.py | New E2E smoke tests for Metadata GraphQL queries. |
| test_e2e/test_jobs.py | New E2E coverage for refresh jobs and wait_for_job() completion paths. |
| test_e2e/test_favorites.py | New E2E coverage for favorites on workbooks/views/datasources. |
| test_e2e/test_datasources_crud.py | New datasource CRUD E2E coverage (publish/get/update/connections/tags/download/delete). |
| pyproject.toml | Registers the new e2e_admin marker. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
Copilot review findings on #1823. (1) test_users_groups.py: every user/group name is now suffixed with a uuid via a _unique(prefix) helper. Fixed names caused 409 conflicts when two runs executed against the same site in parallel, or when a prior run crashed before its finally block removed the resource. (2) test_workbook_permissions.py: wrap the delete_permission call in test_update_permissions_appears_on_populate's finally block in try/except, matching the sibling test_delete_permission_removes_rule. Unwrapped cleanup can raise (e.g. rule already gone, transient server error) and mask the original assertion failure with a confusing "delete_permission raised 500" instead of the actual test failure. No production code touched.
There was a problem hiding this comment.
Copilot reviewed 15 out of 17 changed files in this pull request and generated no new comments.
Suppressed comments (2)test_e2e/conftest.py:80
def default_project(server):
"""Return a project to publish into, shared across all test modules.
Uses TABLEAU_PROJECT env var if set (default: "Default"). Falls back to
"Personal Work" then the first available project.
test_e2e/test_workbook_permissions.py:29
try:
user = TSC.UserItem("tsc-e2e-perm-testuser", TSC.UserItem.Roles.Viewer)
user = server_admin.users.add(user)
except Exception:
Sorry, something went wrong.
- conftest.py: warn when TABLEAU_VERIFY_SSL=false so a disabled SSL check is loud, not silent. - test_favorites.py::test_favorites_view: skip instead of IndexError if the published workbook has no views. - test_jobs.py::test_workbook_refresh_job_completes: skip on JobFailedException; a missing extract is a precondition, not a bug. - test_site_admin.py: name ScheduleItem kwargs (priority=50/60 vs bare positional ints) so the schedule intent reads at a glance. - test_views_export.py::a_view fixture: skip instead of fail when the workbook has no views. Not addressed here (in-line justifications for the PR replies): - BytesIO as filepath in test_workbook_download_returns_nonempty_bytes: the download() @overload accepts FileObjectW (any writable), so a BytesIO buffer is a valid caller and this test IS the coverage. - _unique() sweep to test_workbooks_crud / test_datasources_crud: those publish with PublishMode.Overwrite so cross-run collisions self-heal; uuid suffixes would defeat orphan cleanup after a crashed run.
|
Second-pass review sweep — 866049f addresses the remaining Copilot findings:
One Copilot finding rejected: BytesIO() as filepath= in test_workbook_download_returns_nonempty_bytes — the workbooks.download() @overload block (workbooks_endpoint.py:400-407) explicitly accepts a FileObjectW (writable file-like), so a BytesIO buffer is a supported caller and this test is the coverage. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Test plan
🤖 Generated with Claude Code