Skip to content

Chore: make console width deterministic in tests#5477

Merged
georgesittas merged 1 commit intomainfrom
jo/fix_cli_flakyness
Oct 3, 2025
Merged

Chore: make console width deterministic in tests#5477
georgesittas merged 1 commit intomainfrom
jo/fix_cli_flakyness

Conversation

@georgesittas
Copy link
Contributor

I tried running pytest -n auto tests/cli/test_cli.py from a different system, locally, and started seeing assertion errors related to line break positioning:

FAILED tests/cli/test_cli.py::test_plan_dev_longnames - AssertionError: assert 'sqlmesh_example__dev_butamuchlongerenvironmentname.seed_cccccccccccccccccccccccc\ncccccccccccccccccccccccccccccccccccccccccccccccccccccccc_model          [ins...
FAILED tests/cli/test_cli.py::test_plan_nonbreaking_noautocategorization - AssertionError: assert '[1] [Breaking] Backfill sqlmesh_example.incremental_model and indirectly \nmodified children' in '.\n=========================================================...
FAILED tests/cli/test_cli.py::test_run_cron_not_elapsed - AssertionError: assert 'No models are ready to run. Please wait until a model `cron` interval has \nelapsed.\n\nNext run will be ready at ' in 'No models are ready to run. Please wai...
FAILED tests/cli/test_cli.py::test_init_interactive_engine_install_msg - assert 'Run command in CLI to install your SQL engine\'s Python dependencies: pip \ninstall "sqlmesh[gcppostgres]"' in '──────────────────────────────\nWelcome to SQLMesh!\n─────────...

Similarly, some other tests failed in the suite. Ultimately, it appears that the rich console inherited my environment's $COLUMNS which wasn't 80 and that resulted in said behavior.

@georgesittas georgesittas requested a review from a team October 3, 2025 08:21
@georgesittas georgesittas enabled auto-merge (squash) October 3, 2025 08:23
@georgesittas georgesittas merged commit 93c7a10 into main Oct 3, 2025
35 of 36 checks passed
@georgesittas georgesittas deleted the jo/fix_cli_flakyness branch October 3, 2025 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants