Fix: unblock column_config E2E tests in CI - #5
Closed
sfc-gh-mbarnes wants to merge 1 commit into
Closed
Conversation
The Tier 1 column_config changes (420fc1e) caused widespread Playwright failures. Two distinct bugs were at play: 1. Stale wheel in cached venv. `.github/workflows/playwright.yml` caches `venv` with a key that only rolls daily. Subsequent same-day runs restore the venv including a previous `streamlit-pivot==0.3.0` wheel. `pip install -r test-requirements.txt` then sees "Requirement already satisfied" and silently skips the freshly-built wheel in `dist/`, leaving the test run to exercise pre-Tier-1 code. Force-reinstall the local wheel with `--force-reinstall --no-deps` so the venv always reflects HEAD, regardless of cache hits. 2. Unreachable measure-header assertions. The two measure-header tests (`test_column_config_label_measure`, `test_column_config_help_tooltip_measure`) target `<th data-testid="pivot-header-cell">`, which the renderer only emits on the `config.columns.length === 0` branch. The app configs used `columns=["Year"]` with a single value, so that cell never rendered and the assertions had nothing to match. Drop the col dim from the two affected apps so the single-value measure header renders. Verified end-to-end by simulating the CI cache scenario locally (stale 0.3.0 wheel preinstalled, then the fixed workflow steps): all 7 column_config tests pass (previously 0). Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Tier 1
column_configfeature commit (420fc1e) caused the Playwright suite to fail in this CI run. Root-cause analysis identified two distinct bugs, both fixed here.1. Stale wheel in cached venv (CI workflow)
.github/workflows/playwright.ymlcachesvenvwith a key that only rolls daily. Same-day reruns restore the venv including a previously-installedstreamlit-pivot==0.3.0wheel.pip install -r test-requirements.txtthen prints:…and silently skips the freshly-built wheel, leaving the test run to exercise pre-Tier-1 code. Reproduced locally byte-for-byte by installing a wheel built from
1e2edfc(pre-Tier-1) into a fresh venv, then runningpip installagainst a same-versioned fresh wheel.Fix: after
pip install -r test-requirements.txt, force-reinstall the local wheel:pip install --force-reinstall --no-deps dist/streamlit_pivot-*.whl--no-depskeeps the dep cache useful; the wheel is ~900 KB so the extra step adds ~1s. A comment documents why.2. Unreachable measure-header assertions (test app)
test_column_config_label_measureandtest_column_config_help_tooltip_measureassert on<th data-testid="pivot-header-cell">, whichTableRenderer.tsxonly emits on theconfig.columns.length === 0branch (renderers/TableRenderer.tsxline ~1520). The two apps usedcolumns=["Year"]with a single value, so that cell never rendered — the assertions failed even in an editable install against HEAD, independent of the caching bug.Fix: drop
columns=["Year"]fromtest_pivot_cc_labelandtest_pivot_cc_helpso the single-value measure header renders.Verification
Simulated the CI scenario locally end-to-end:
1e2edfc(pre-Tier-1), installed into a fresh venv (simulates cache restore).pip install -r <reqs>→ pip printed "already installed with the same version" and skipped. Venv retained 0 occurrences offield_labels/field_renderersin Python and JS (matches CI symptom).--force-reinstall --no-deps) → venv now has 13 / 5 occurrences offield_labelsmatchingHEAD.pivot_table_column_config_test.pysuite against the force-reinstalled venv: 7/7 pass (up from 0). Same result in the local editable-install venv.Test plan
pivot_table_column_config_test.pypasses locally (chromium): 7/7.pivot_table_column_config_test.pypasses against the simulated-CI venv with both fixes applied: 7/7.ruff,ruff-format, license headers, formatting).Made with Cursor