Skip to content

tests: run the production pbr.uc, not a rewritten copy - #205

Merged
stangri merged 1 commit into
mossdef-org:1.2.4from
egc112:pbr-1.2.4-tests-no-source-rewrite
Nov 9, 2026
Merged

stangri merged 1 commit into
mossdef-org:1.2.4from
egc112:pbr-1.2.4-tests-no-source-rewrite

Conversation

@egc112

@egc112 egc112 commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

run_tests.sh rewrote pbr.uc with sed and awk into a temporary directory and tested that copy. Both steps are leftovers:

  • the sed converts fs, uci and ubus imports to require(), but pbr.uc no longer has those imports; it gets the modules through create_pbr()
  • the awk forward-declares top-level functions, and create_pbr is the only one left

Delete both and load files/lib/pbr directly, so the tests exercise the file that ships. This takes 90 lines out of the runner and also removes its need for gawk. The shim has caused harm before: see #174.

Suggested in the review of openwrt/packages#31156. The suite gives the same 75 of 75 before and after, on the ucode in OpenWrt 25.12 (85922056) and on current master.

Assisted-by: Claude:claude-opus-5-5

run_tests.sh rewrote pbr.uc with sed and awk into a temporary directory
and tested that copy. Both steps are leftovers:

- the sed converts fs, uci and ubus imports to require(), but pbr.uc no
  longer has those imports; it gets the modules through create_pbr()
- the awk forward-declares top-level functions, and create_pbr is the
  only one left

Delete both and load files/lib/pbr directly, so the tests exercise the
file that ships. This takes 90 lines out of the runner and also removes
its need for gawk. The shim has caused harm before: see mossdef-org#174.

Suggested in the review of openwrt/packages#31156. The suite gives the
same 75 of 75 before and after, on the ucode in OpenWrt 25.12 (85922056)
and on current master.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Erik Conijn <egc112@msn.com>
@stangri
stangri merged commit f6c8801 into mossdef-org:1.2.4 Nov 9, 2026
3 checks passed
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