zebra icon indicating copy to clipboard operation
zebra copied to clipboard

devops: Align tests names in CI, Docker and Rust code

Open gustavovalverde opened this issue 11 months ago • 6 comments

Describe the issue or request

It's hard for the team to know which CI test ID is running a specific Rust test, and how those matches with the Docker entrypoint.

Expected Behavior

Have a single name convention for tests across the project:

  • CI Job Names
    • changing these requires admin updates to branch protection rules
  • CI Test IDs
    • limit to 20 characters, otherwise we get a regression to bug #7559
    • changing these requires admin updates to branch protection rules for some sub-workflows
  • Rust Code
  • Docker entrypoint environment variables
    • some environment variables are used inside the Rust code itself, so they can't be changed

Current Behavior

We have a test called test-empty-sync in CI, but in Rust it actually triggers with the sync_large_checkpoints_{mainnet,testnet} test names.

Or having test-lightwalletd-integration in CI, which also requires a ZEBRA_TEST_LIGHTWALLETD ENV variable, to trigger the lightwalletd_integration Rust test.

Possible Solution

Use the same test names and try to trigger the test passing CLI parameters instead of ENV variables.

Do a mass rename to reliably change the names in scripts, workflows, Rust, and documentation: https://github.com/ZcashFoundation/zebra/blob/main/book/src/dev/mass-renames.md

Avoid changing job names and job IDs, or do it in a separate PR, because updating branch protection rules is a manual task.

CI Test IDs should be limited to 20 characters, otherwise long branch names will fail (see bug #7559).

Additional Information/Context

No response

Is this happening on PRs?

N/A

Is this happening on the main branch?

N/A

gustavovalverde avatar Sep 13 '23 06:09 gustavovalverde

Hey team! Please add your planning poker estimate with Zenhub @teor2345 @upbqdn @oxarbitrage @arya2

gustavovalverde avatar Sep 13 '23 07:09 gustavovalverde

I was just thinking of this change today, when I had to copy almost exactly the same workflow arguments between a full sync and an update sync. If we used consistent names, it would be easier to see which jobs are similar to each other.

(And maybe in the future we could create those syncs from the same workflow, which contains all the detailed arguments. So the top-level workflow would just need a full/update argument. Or maybe that's too complicated.)

teor2345 avatar Sep 13 '23 07:09 teor2345

I added "CI Test IDs" to the list of names, with this note:

CI Test IDs should be limited to 20 characters, otherwise long branch names will fail (see bug #7559).

teor2345 avatar Sep 20 '23 20:09 teor2345

@gustavovalverde have you also been working on this one?

mpguerra avatar Oct 24 '23 10:10 mpguerra

I added some notes to the PR description about the names that are hard to change, because we need to change branch protection rules as well.

I think we could do this ticket relatively quickly by changing most environment variables to Rust test names in the entrypoint script. (Some environment variables are used inside the Rust code and can't be changed.)

Then we find everywhere those environment variables are used and rewrite those commands.

teor2345 avatar Oct 24 '23 19:10 teor2345

@gustavovalverde have you also been working on this one?

@mpguerra Not yet

gustavovalverde avatar Oct 25 '23 09:10 gustavovalverde