securedrop icon indicating copy to clipboard operation
securedrop copied to clipboard

ci(translation): save screenshots as workflow artifacts

Open cfm opened this issue 1 year ago • 4 comments

Status

Ready for review

Description of Changes

Fixes #7237 by saving the screenshots generated by make translation-test as CI artifacts for 24 hours, for the following reasons:

  1. make translation-test generates them no matter what, so we might as well make them inspectable.
  2. #7237 occurs only locally, where this code path is rarely used; let's take advantage of CI exercising it.
  3. This points towards perhaps even updating Weblate's copy of screenshots directly from these tests run nightly on develop.

Fixes #7241 by correcting the parameterization of tests and fixtures for page-layout tests. See individual commits for details.

Testing

  • [ ] Visual review.
  • [ ] Inspect a couple of languages and confirm that their screenshots are correct.
  • ~24 hours is a reasonable retention period for 100 MB of screenshots per run.~

Deployment

CI-only; no deployment considerations.

cfm avatar Oct 04 '24 23:10 cfm

Good catch, @legoktm. I'm looking into this in #7241.

cfm avatar Oct 07 '24 21:10 cfm

The fixes are in as of https://github.com/freedomofpress/securedrop/issues/7241#issuecomment-2398211481. Two cheers for putting rarely-exercised code paths in CI! Back to you, @legoktm.

cfm avatar Oct 07 '24 23:10 cfm

I wrestled with this some more today and found another problem with how the firefox_web_driver fixture was parameterized, which I've refactored in 7900e21b6326e6b86cb0ee145a15bed7f9fb67ed. Back to you for real, @legoktm.

cfm avatar Oct 11 '24 23:10 cfm

When I download screenshots-de_DE from https://github.com/freedomofpress/securedrop/actions/runs/11300734349, I see three subfolders, de-DE, de_DE, and en-US. So somewhere the dash is being normalized differently?

And...the de screenshots are still in English :/

legoktm avatar Oct 16 '24 15:10 legoktm

The good news is that the screenshots are being captured correctly. The bad news is that the tests themselves still aren't (and haven't been) parameterized fully with the intended locale. I'm looking into it.

cfm avatar Nov 20 '24 23:11 cfm

I found a couple more fundamental parameterization problems yesterday and today, for which I've just force-pushed fixes. I'm going to monitor translation-tests for failing string checks before this is ready for another review.

cfm avatar Nov 21 '24 20:11 cfm

I'd be happy to approve parts of this in separate PRs if that would be easier for you. e.g. the saving as artifacts part is totally fine and good to go, same with some of the other intermediate fixes.

legoktm avatar Nov 22 '24 01:11 legoktm

Thanks, @legoktm. As of 6c9917c771187bf9ac4c08dc46df35d367245986 I've now got this sorted for the Journalist Interface in Firefox. Tomorrow I should be able to fix up the Source Interface in Tor Browser the same way. If not, I'll split it between the two interfaces.

cfm avatar Nov 22 '24 05:11 cfm

Ready here for the Journalist Interface. The Source Interface I've deferred to #7354.

cfm avatar Nov 25 '24 19:11 cfm