Skip to content

Restore upstream sanity tests t/003safesys.t and t/013dbschema.t#160

Open
mrenvoize wants to merge 1 commit into
bugzilla:mainfrom
mrenvoize:restore-sanity-tests
Open

Restore upstream sanity tests t/003safesys.t and t/013dbschema.t#160
mrenvoize wants to merge 1 commit into
bugzilla:mainfrom
mrenvoize:restore-sanity-tests

Conversation

@mrenvoize

Copy link
Copy Markdown
Contributor

These two sanity tests exist in 5.2 but were dropped during Harmony's divergence. Restoring them re-adds cheap, orthogonal guardrails.

t/013dbschema.t (SQL reserved-word check):

  • Adapted to Harmony's schema API: use the positional-driver factory Bugzilla::DB::Schema->new('Mysql') instead of upstream's Moo-style ->new(db => $fake_db), which Harmony does not have.
  • Whitelisted ACTION, DATA, DOMAIN and TIMESTAMP, following upstream's existing practice of exempting words that are already used as table/ column names (VALUE, TYPE, ALIAS, COALESCE). These four are used by the AntiSpam, BugmailFilter, Push and RequestNagger tables and are safe on every supported backend because Bugzilla quotes identifiers.

t/003safesys.t (safe system/exec usage):

  • Passes 653/653 after fixing one call in RequestNagger's send-request-nags.pl to pass the program and its arguments explicitly (system($command[0], @command[1 .. $#command])) so it satisfies the Support::Systemexec prototype instead of passing a single list.

t/001compile.t is intentionally NOT restored here: making it pass requires updating the shared t/Support/Files.pm to understand Harmony's Bugzilla::Extension:: module layout and to skip .disabled files and feature-gated modules. That is tracked as separate follow-up work.

These two sanity tests exist upstream but were dropped during Harmony's
divergence. Restoring them re-adds cheap, orthogonal guardrails.

t/013dbschema.t (SQL reserved-word check):
  - Adapted to Harmony's schema API: use the positional-driver factory
    Bugzilla::DB::Schema->new('Mysql') instead of upstream's Moo-style
    ->new(db => $fake_db), which Harmony does not have.
  - Whitelisted ACTION, DATA, DOMAIN and TIMESTAMP, following upstream's
    existing practice of exempting words that are already used as table/
    column names (VALUE, TYPE, ALIAS, COALESCE). These four are used by
    the AntiSpam, BugmailFilter, Push and RequestNagger tables and are
    safe on every supported backend because Bugzilla quotes identifiers.

t/003safesys.t (safe system/exec usage):
  - Passes 653/653 after fixing one call in RequestNagger's
    send-request-nags.pl to pass the program and its arguments explicitly
    (system($command[0], @command[1 .. $#command])) so it satisfies the
    Support::Systemexec prototype instead of passing a single list.

t/001compile.t is intentionally NOT restored here: making it pass requires
updating the shared t/Support/Files.pm to understand Harmony's
Bugzilla::Extension:: module layout and to skip .disabled files and
feature-gated modules. That is tracked as separate follow-up work.
@mrenvoize mrenvoize force-pushed the restore-sanity-tests branch from 5b97e93 to ffc23eb Compare July 3, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant