Skip to content

Interactive env var overrides#3

Open
tzaffi wants to merge 12 commits intodevelopfrom
interative-env-var-overrides
Open

Interactive env var overrides#3
tzaffi wants to merge 12 commits intodevelopfrom
interative-env-var-overrides

Conversation

@tzaffi
Copy link
Copy Markdown
Owner

@tzaffi tzaffi commented Feb 17, 2023

Archived Defunct py-algorand-sdk PR # 429

Formerly: algorand#429

I'm keeping for my own future testing purposes

Should I keep these changes around and merge harness_overwrite.py? This tinkering work grew out of an investigation of the downstream effects of this go-algorand PR: algorand/go-algorand#4951

Arguments For and Against Merging the PR

  • DO NOT MERGE
    • This violates the goal of keeping up.sh as similar as possible across all 4 SDK's
    • Even if we decide that this should exist in all 4 SDK's, it's written in Python, and we can't impose installing Python across the other SDK's
    • It's not useful enough to justify the future maintenance costs
  • MERGE
    • It's okay to have small "violations" of the uniformity goal, if there is a clear upside
    • Anything that eases the investigation of downstream implications for changes in go-algorand -even a little- is worthwhile
    • Python is so ubiquitous for shell scripting; we could impose requiring it in all the SDK's - imagine how much easier life would be if we could dispense with shell scripting in favor of python scripting?

Q: What does harness_overwrite.py do?

It makes it slightly easier locally to mod environments that the test harness needs. In particular

  1. set INTERACTIVE_TESTING_ENVIRONMENT=1 in .test-env
  2. run make harness and follow the prompts.

here are what the prompts look like

Which of the following env vars do you want to modify?

VERBOSE_HARNESS,TYPE,ALGOD_CHANNEL,ALGOD_URL,ALGOD_BRANCH,ALGOD_SHA,NETWORK_TEMPLATE,NETWORK_NUM_ROUNDS,INDEXER_URL,NODE_ARCHIVAL,INDEXER_BRANCH,INDEXER_SHA,SANDBOX_URL,SANDBOX_BRANCH,LOCAL_SANDBOX_DIR,ALGOD_CONTAINER,KMD_PORT,ALGOD_PORT,INDEXER_CONTAINER,INDEXER_PORT,POSTGRES_CONTAINER,POSTGRES_PORT

    (skip for ALL, or provide comma separated)
    
    A typical choice is:
TYPE,ALGOD_URL,ALGOD_BRANCH

CHOICES:

Then I entered the "typical choice" and proceeded with the next prompts:

...

CHOICES:
TYPE,ALGOD_URL,ALGOD_BRANCH
__________________________________________________
Please provide env variable overrides (skip to keep defaults)
TYPE (default `"channel"`):source
ALGOD_URL (default `"https://github.com/algorand/go-algorand"`):https://github.com/tzaffi/go-algorand
ALGOD_BRANCH (default `"master"`):improve-some-goal-errors
__________________________________________________
OVERWRITING
new_env[TYPE]=source (PREVIOUS: env[TYPE]="channel")
new_env[ALGOD_URL]=https://github.com/tzaffi/go-algorand (PREVIOUS: env[ALGOD_URL]="https://github.com/algorand/go-algorand")
new_env[ALGOD_BRANCH]=improve-some-goal-errors (PREVIOUS: env[ALGOD_BRANCH]="master")
__________________________________________________
...

Q: What are the implications for harness_overwrite.py in C.I.?

As long as one remembers not to merge in INTERACTIVE_TESTING_ENVIRONMENT=1 in .test-env,
C.I. will continue running as before. In order to run the same override environment in C.I., you
need to take the following steps:

  1. Follow the steps above to locally overwrite test-harness/.env
  2. Copy the file portion in the resulting .env file starting from TYPE=... all the way to the end into .test-env
  3. Make sure to set INTERACTIVE_TESTING_ENVIRONMENT=0 and OVERWRITE_TESTING_ENVIRONMENT=1
  4. Commit these changes and push to github

C.I. should now run against the new harness env variables.

@tzaffi tzaffi changed the title Interative env var overrides Interactive env var overrides Feb 17, 2023
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.

1 participant