Skip to content

Implement idempotency test for run_key_migration_functions#8050

Draft
acwhite211 wants to merge 2 commits intomainfrom
issue-8042
Draft

Implement idempotency test for run_key_migration_functions#8050
acwhite211 wants to merge 2 commits intomainfrom
issue-8042

Conversation

@acwhite211
Copy link
Copy Markdown
Member

Fixes #8042

Adds a Django regression test for the run_key_migration_functions management command to verify that it can be run repeatedly without creating duplicate migration-backed records.

The test snapshots relevant database record counts before the command runs, after the first run, and after a second run. The first run is expected to create or backfill records, while the second run must leave tracked record counts unchanged.

There is tracking on counts for models touched by the command, including collection object types, picklists, schema config records, permissions records, app resource dirs, uniqueness rules, and tectonic unit records. I also went ahead and added user-created picklist and permission records before the first run and between runs to simulate normal Specify 7 usage. We could try doing more here to simulate other Specify 7 usage.

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add pr to documentation list
  • Add automated tests

Testing instructions

  • See the the back-end testing github action runs successfully.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e066de5f-0c8e-4762-84ab-b7af4c0c400f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-8042

Comment @coderabbitai help to get the list of available commands and usage tips.

@CarolineDenis CarolineDenis modified the milestones: 7.12.2, 7.12.1 May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋Back Log

Development

Successfully merging this pull request may close these issues.

Add record count idempotency tests for run_key_migration_functions

2 participants