Closed Bug 1452962 Opened 7 years ago Closed 7 years ago

Write a test to verify migration recipes

Categories

(Localization Infrastructure and Tools :: Fluent Migration, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1321281

People

(Reporter: flod, Unassigned)

Details

Not sure if this bug belongs to this component, in case feel free to move it around. While writing migrations for bug 1451992, I realized how much manual work I do for testing migration recipes. In a scenario where other people might start writing them, we need an easier and reliable way to test migrations. Here's what I currently do. 1) Create a copy of gecko-strings-quarantine. Let's call it "fake-en" 2) Save the migration recipe, run the migration against fake-en using my scripts 3) Compare the resulting FTL file (visual diff) with the one added in the patch I think we should have a test that runs whenever a patch adds a migration recipe, not sure how it would work though. Initially I thought: I'm going to create a local script to automate the manual work I'm currently doing, and use that as a base. I think I could build something, but it would be hacky, and hardly reusable as a starting point for such test. For example, I would expect the test to: 1) Run only if the patch contains changes to migration recipes 2) Identify the FTL files affected by this recipe 3) Run the migration against a temporary clone of gecko-strings-quarantine 4) Parse the migrated file, compare it with the one provided in the patch. All strings existing in both files should be identical, all string referenced in the migration should be available in the generated file. Additional notes: * You can't run the migration against mozilla-central. The paths are now incompatible, and more important a patch removes DTD and properties file if it's doing a migration * You can't test for the files being identical: a patch can add new strings to FTL that are not coming out of a migration. * It would be nice to check for common errors, like variant names in PLATFORM() expressions.
Summary: Write a test to verify migrations → Write a test to verify migration recipes
Is this a dupe of bug 1321281, or blocked by it?
It's a dupe, but it has good ideas :) Would you mind copying and pasting your comment to bug 1321281 to keep it all in once please, please?
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.