Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(CI) - add possibility to point harmony-test repo to non-master branch via CI and locally #4730

Merged

Conversation

mur-me
Copy link
Collaborator

@mur-me mur-me commented Aug 8, 2024

TL;DR: this PR give us an easier way to point to any harmony-test repo branch, details below.

What was done:

  • add possibility to point harmony-test repo to non-master branch via CI, for this I've added this logic -
    # handle for the Travis build run:
    # * uses TRAVIS_PULL_REQUEST_BRANCH for RP branch
    # * uses TRAVIS_BRANCH for simple branch builds
    MAIN_REPO_BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-${TRAVIS_BRANCH}}
    , if it is PR - use special PR env, if it is regular branch - use branch env.
    • Q: why not to check it vice-versa like MAIN_REPO_BRANCH=${TRAVIS_BRANCH:-${TRAVIS_PULL_REQUEST_BRANCH}}?
    • A: Because TRAVIS_BRANCH becomes the branch name in which you want to merge, dev in my case
  • add MAIN_REPO_BRANCH to point exactly the same repo version in the test run instead of hardcoded main branch
  • cover local runs of travis_rosetta_checker.sh and travis_rpc_checker.sh, it will support the same logic as in CI, if your branch in already on remote, else use dev branch for harmony-test repo

===

user@laptop:~/go/src/github.com/harmony-one/harmony$ ./scripts/travis_rpc_checker.sh 
[harmony-test repo] - working on 'master' branch
[harmony repo] - working on 'feat/TRAVIS_CI_add_possibility_to_point_to_non_master_branch' branch
...
=> [ 8/23] RUN git clone --branch feat/TRAVIS_CI_add_possibility_to_point_to_non_master_branch https://github.com/harmony-one/harmony.git > /dev/null 2>1
  • the same logic applies for the local rossetta tests:
user@laptop:~/go/src/github.com/harmony-one/harmony$ ./scripts/travis_rosetta_checker.sh 
[harmony-test repo] - working on 'master' branch
[harmony repo] - working on 'feat/TRAVIS_CI_add_possibility_to_point_to_non_master_branch' branch
...
 => [ 8/23] RUN git clone --branch feat/TRAVIS_CI_add_possibility_to_point_to_non_master_branch https://github.com/harmony-one/harmony.git > /dev/null 2>1
  • example of fresh local-only branch run, you can see this WARN about local only:
user@laptop:~/go/src/github.com/harmony-one/harmony$ ./scripts/travis_rosetta_checker.sh 
[WARN] - Git branch 'test_demo' does not exist in the remote repository, using 'dev' branch as a workaround for a local-only branch
[harmony-test repo] - working on 'master' branch
[harmony repo] - working on 'dev' branch
=> [ 8/23] RUN git clone --branch dev https://github.com/harmony-one/harmony.git > /dev/null 2>1

Issue

Test

Unit Test Coverage

Before:

<!-- copy/paste 'go test -cover' result in the directory you made change -->

After:

<!-- copy/paste 'go test -cover' result in the directory you made change -->

Test/Run Logs

Operational Checklist

  1. Does this PR introduce backward-incompatible changes to the on-disk data structure and/or the over-the-wire protocol?. (If no, skip to question 8.)

    YES|NO

  2. Describe the migration plan.. For each flag epoch, describe what changes take place at the flag epoch, the anticipated interactions between upgraded/non-upgraded nodes, and any special operational considerations for the migration.

  3. Describe how the plan was tested.

  4. How much minimum baking period after the last flag epoch should we allow on Pangaea before promotion onto mainnet?

  5. What are the planned flag epoch numbers and their ETAs on Pangaea?

  6. What are the planned flag epoch numbers and their ETAs on mainnet?

    Note that this must be enough to cover baking period on Pangaea.

  7. What should node operators know about this planned change?

  8. Does this PR introduce backward-incompatible changes NOT related to on-disk data structure and/or over-the-wire protocol? (If no, continue to question 11.)

    YES|NO

  9. Does the existing node.sh continue to work with this change?

  10. What should node operators know about this change?

  11. Does this PR introduce significant changes to the operational requirements of the node software, such as >20% increase in CPU, memory, and/or disk usage?

TODO

@mur-me mur-me force-pushed the feat/TRAVIS_CI_add_possibility_to_point_to_non_master_branch branch 9 times, most recently from fbcb5d4 to c8f4b8d Compare August 9, 2024 10:18
@mur-me mur-me changed the title feat(Dockerfile) - add argument TEST_REPO_BRANCH to point add feat(Dockerfile) - add possibility to point harmony-test repo to non-master branch via CI and locally Aug 9, 2024
…ranch via CI, add MAIN_REPO_BRANCH to point exaclty the same repo version in the test run instead of hardcoded main branch, cover local runs of travis_rosetta_checker.sh and travis_rpc_checker.sh
@mur-me mur-me force-pushed the feat/TRAVIS_CI_add_possibility_to_point_to_non_master_branch branch from c8f4b8d to 8b1cda4 Compare August 9, 2024 14:16
@mur-me mur-me changed the title feat(Dockerfile) - add possibility to point harmony-test repo to non-master branch via CI and locally feat(CI) - add possibility to point harmony-test repo to non-master branch via CI and locally Aug 9, 2024
@mur-me mur-me marked this pull request as ready for review August 9, 2024 15:22
@mur-me mur-me self-assigned this Aug 9, 2024
@GheisMohammadi
Copy link
Contributor

Great job 👏

@mur-me mur-me merged commit 6e6783b into dev Aug 13, 2024
4 checks passed
@mur-me mur-me deleted the feat/TRAVIS_CI_add_possibility_to_point_to_non_master_branch branch August 13, 2024 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants