Skip to content

Add tests for pretext build -g (force asset regeneration)#1125

Merged
oscarlevin merged 6 commits intomainfrom
copilot/add-pretext-build-g-to-tests
Mar 21, 2026
Merged

Add tests for pretext build -g (force asset regeneration)#1125
oscarlevin merged 6 commits intomainfrom
copilot/add-pretext-build-g-to-tests

Conversation

Copy link
Contributor

Copilot AI commented Mar 20, 2026

pretext build -g had no test coverage, which allowed a behavioral regression to ship in the 1.2 release undetected.

Changes

  • New test test_build_generate in tests/test_cli.py covering all documented behaviors of the generate/no-generate flags against the existing graphics example project (asymptote + prefigure assets):
    • build -q → assets skipped entirely
    • build -g → assets force-generated regardless of prior state; build output produced
    • build after build -g with source unchanged → hash matches, deleted asset stays missing (caching works)
    • build -g after hash is saved → still regenerates unconditionally
    • build -g -q together → warning emitted, flags cancel out, behaves like normal build

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • runestone.academy
    • Triggering command: /usr/bin/python3 python3 scripts/fetch_core.py (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Add pretext build -g to tests</issue_title>
<issue_description>No time to look into it now, but the behavior of this command must be different than what we are testing, since it caught us on the 1.2 release. See https://groups.google.com/g/pretext-dev/c/klKMunE1kAg</issue_description>

Comments on the Issue (you are @copilot in this section)

@oscarlevin Not sure the status of this, since the issue is very old. Check the generate documentation in docs to see expected behavior and write better tests.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add pretext build -g to tests for improved behavior Add tests for pretext build -g (force asset regeneration) Mar 20, 2026
Copilot AI requested a review from oscarlevin March 20, 2026 15:28
@oscarlevin oscarlevin force-pushed the copilot/add-pretext-build-g-to-tests branch from 04ace6f to f335d71 Compare March 21, 2026 22:05
@oscarlevin oscarlevin marked this pull request as ready for review March 21, 2026 23:04
@oscarlevin oscarlevin merged commit 461a6e7 into main Mar 21, 2026
6 checks passed
@oscarlevin oscarlevin deleted the copilot/add-pretext-build-g-to-tests branch March 21, 2026 23:27
Copilot AI added a commit that referenced this pull request Mar 22, 2026
* Initial plan

* Add test_build_generate to test pretext build -g behavior

Co-authored-by: oscarlevin <6504596+oscarlevin@users.noreply.github.com>
Agent-Logs-Url: https://github.com/PreTeXtBook/pretext-cli/sessions/782c1d2c-2645-447a-9a8d-371f40e95808

* update core commit

* update tests

* remove passagemath as dev dependency

* commit new test example files

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: oscarlevin <6504596+oscarlevin@users.noreply.github.com>
Co-authored-by: Oscar Levin <oscar.levin@unco.edu>
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.

Add pretext build -g to tests

2 participants