Skip to content

Localizer integration: end-to-end test executing the CLI commands on real project data #220

Description

@gildor

Background

The plugin delegates all localization work to the bandlab-localizer CLI (LocalizerOps):

  • update-strings (full sync)
  • update-strings --update-keys <keys>
  • update-strings --add-keys <keys> --target-file <path>
  • update-strings --delete-keys <keys>

Localizer 3.2.0 renamed --add-keys-to-file--target-file (localizer #152). The plugin kept
emitting the old flag and nothing failed in CI — no test asserts the argv we send to the CLI.

Done already (flag-surface contract)

LocalizerCliContractTest now asserts every flag the plugin emits is a recognised update-strings
option, via update-strings --help — no network, no Tolgee creds. It runs against the localizer jar
pinned to the version the app's wrapper uses (LOCALIZER_JAR, currently 3.2.0) and self-skips when
that env var is unset, so the default hermetic ./gradlew test is unaffected. This would have caught
the rename instantly.

This issue: real end-to-end execution

Go beyond the --help surface and actually run the commands against real-shaped project data, so
we catch behavioural drift (output format, exit codes, [[file]] routing), not just flag names.

Proposed shape

  • Fixture from bandlab-android. Copy a small, realistic slice: the bandlab-localizer wrapper
    pinned to the app's version, a bandlab-localizer-config.toml, and a couple of [[file]] entries
    with their base + translation strings.xml. ⚠️ Scrub the Tolgee api-key from the copied
    config — the real one must not be committed; use a dummy / ${TOLGEE_API_KEY} interpolation.
  • Creds-free path (always runs when a jar is available): execute update-strings --delete-keys <key>
    on the fixture and assert the key is removed from the base file and every translation, exit 0.
    Delete needs zero network/creds.
  • Tolgee path (opt-in, gated on a live key): --add-keys … --target-file, --update-keys, and
    full sync hit Tolgee. Run these against keys copied from the Android project when TOLGEE_API_KEY
    is present; skip otherwise.
  • Gating: a separate tagged task / source set, off by default and excluded from check, so the
    hermetic ./gradlew test and normal CI stay green. Optionally a dedicated CI job that builds the
    localizer jar (or pulls the pinned release) and runs it.

Acceptance

  • Fixture copied from bandlab-android with the api-key scrubbed.
  • --delete-keys executed end-to-end; asserts removal from base + all translations.
  • add/update/full-sync executed when TOLGEE_API_KEY is set; skipped cleanly otherwise.
  • Lives behind a separate task; default ./gradlew test unchanged.

Follow-up to the --target-file fix and LocalizerCliContractTest. Relates to #214.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions