Skip to content

Commit

Permalink
chore(integration): remove _helpers & fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
tknickman committed Jan 30, 2024
1 parent 3c5e553 commit e5d7b86
Show file tree
Hide file tree
Showing 30 changed files with 63 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# 2023-04-06T04:28:19.599Z [DEBUG] turbo: global hash: value=a027dadc4dea675e
#
# Usage:
# turbo build -vv 2>&1 | "$TESTDIR/./get-global-hash.sh"
# turbo build -vv 2>&1 | "$TESTDIR/./find_global_hash.sh"
#
#
grep "global hash:" - | awk '{split($0,a,"="); print a[2]}'
2 changes: 1 addition & 1 deletion turborepo-tests/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh single_package

Custom config
$ . ${TESTDIR}/../../helpers/replace_turbo_config.sh $(pwd) "my-custom-config.json"
$ . ${TESTDIR}/../../helpers/replace_turbo_json.sh $(pwd) "my-custom-config.json"

Write your tests
...
Expand Down
1 change: 0 additions & 1 deletion turborepo-tests/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"scripts": {
"test": "cross-env ./node_modules/.bin/prysk tests",
"test:interactive": "cross-env PRYSK_INTERACTIVE=true ./node_modules/.bin/prysk tests",
"test:go-fallback": "cross-env EXPERIMENTAL_RUST_CODEPATH=false ./node_modules/.bin/prysk tests",
"test:parallel": ".cram_env/bin/pytest -n auto tests --prysk-shell=`which bash`",
"pretest:parallel": ".cram_env/bin/pip3 install --quiet pytest \"prysk[pytest-plugin]\" pytest-xdist"
},
Expand Down
2 changes: 1 addition & 1 deletion turborepo-tests/integration/tests/bad-turbo-json.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh

Use our custom turbo config with syntax errors
$ . ${TESTDIR}/../../helpers/replace_turbo_config.sh $(pwd) "syntax-error.json"
$ . ${TESTDIR}/../../helpers/replace_turbo_json.sh $(pwd) "syntax-error.json"

Run build with invalid turbo.json
$ EXPERIMENTAL_RUST_CODEPATH=true ${TURBO} build
Expand Down
2 changes: 1 addition & 1 deletion turborepo-tests/integration/tests/command-link.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Setup
$ . ${TESTDIR}/../../helpers/setup.sh
$ . ${TESTDIR}/_helpers/logged_in.sh
$ . ${TESTDIR}/../../helpers/mock_turbo_config.sh

Link Test Run
$ ${TURBO} link --__test-run
Expand Down
2 changes: 1 addition & 1 deletion turborepo-tests/integration/tests/command-logout.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Setup
$ . ${TESTDIR}/../../helpers/setup.sh
$ . ${TESTDIR}/_helpers/logged_in.sh
$ . ${TESTDIR}/../../helpers/mock_turbo_config.sh

Logout while logged in
$ ${TURBO} logout
Expand Down
2 changes: 1 addition & 1 deletion turborepo-tests/integration/tests/command-telemetry.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Setup
$ . ${TESTDIR}/../../helpers/setup.sh
$ . ${TESTDIR}/_helpers/telemetry.sh
$ . ${TESTDIR}/../../helpers/mock_telemetry_config.sh

Run status (with first run message)
$ TURBO_TELEMETRY_MESSAGE_DISABLED=0 ${TURBO} telemetry status
Expand Down
2 changes: 1 addition & 1 deletion turborepo-tests/integration/tests/config.t
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Run test run with remote cache timeout from both env and flag (flag should take
456

Use our custom turbo config with an invalid env var
$ . ${TESTDIR}/../../helpers/replace_turbo_config.sh $(pwd) "invalid-env-var.json"
$ . ${TESTDIR}/../../helpers/replace_turbo_json.sh $(pwd) "invalid-env-var.json"

Run build with invalid env var
$ EXPERIMENTAL_RUST_CODEPATH=true ${TURBO} build
Expand Down
12 changes: 6 additions & 6 deletions turborepo-tests/integration/tests/edit-turbo-json/global.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ Setup

Baseline global hash
$ cp "$TESTDIR/fixture-configs/1-baseline.json" "$(pwd)/turbo.json" && git commit -am "no comment" --quiet
$ BASELINE=$(${TURBO} build -vv 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh")
$ BASELINE=$(${TURBO} build -vv 2>&1 | "$TESTDIR/../../../helpers/find_global_hash.sh")

Update pipeline: global hash remains stable.
$ cp "$TESTDIR/fixture-configs/2-update-pipeline.json" "$(pwd)/turbo.json" && git commit -am "no comment" --quiet
$ UPDATE_PIPELINE=$(${TURBO} build -vv --env-mode=infer 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh")
$ UPDATE_PIPELINE=$(${TURBO} build -vv --env-mode=infer 2>&1 | "$TESTDIR/../../../helpers/find_global_hash.sh")
$ test $BASELINE = $UPDATE_PIPELINE

Update globalEnv: global hash changes.
$ cp "$TESTDIR/fixture-configs/3-update-global-env.json" "$(pwd)/turbo.json" && git commit -am "no comment" --quiet
$ NEW_GLOBAL_ENV=$(${TURBO} build -vv --env-mode=infer 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh")
$ NEW_GLOBAL_ENV=$(${TURBO} build -vv --env-mode=infer 2>&1 | "$TESTDIR/../../../helpers/find_global_hash.sh")
$ test $BASELINE != $NEW_GLOBAL_ENV

Update globalDeps in a non-material way: global hash remains stable.
$ cp "$TESTDIR/fixture-configs/4-update-global-deps.json" "$(pwd)/turbo.json" && git commit -am "no comment" --quiet
$ NEW_GLOBAL_DEPS=$(${TURBO} build -vv --env-mode=infer 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh")
$ NEW_GLOBAL_DEPS=$(${TURBO} build -vv --env-mode=infer 2>&1 | "$TESTDIR/../../../helpers/find_global_hash.sh")
$ test $BASELINE = $NEW_GLOBAL_DEPS

Update globalDeps in a material way: global hash changes.
$ cp "$TESTDIR/fixture-configs/5-update-global-deps-materially.json" "$(pwd)/turbo.json" && git commit -am "no comment" --quiet
$ NEW_GLOBAL_DEPS=$(${TURBO} build -vv --env-mode=infer 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh")
$ NEW_GLOBAL_DEPS=$(${TURBO} build -vv --env-mode=infer 2>&1 | "$TESTDIR/../../../helpers/find_global_hash.sh")
$ test $BASELINE != $NEW_GLOBAL_DEPS

Update passThroughEnv: global hash changes.
$ cp "$TESTDIR/fixture-configs/6-update-passthrough-env.json" "$(pwd)/turbo.json" && git commit -am "no comment" --quiet
$ NEW_GLOBAL_PASSTHROUGH=$(${TURBO} build -vv --env-mode=infer 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh")
$ NEW_GLOBAL_PASSTHROUGH=$(${TURBO} build -vv --env-mode=infer 2>&1 | "$TESTDIR/../../../helpers/find_global_hash.sh")
$ test $BASELINE != $NEW_GLOBAL_PASSTHROUGH
4 changes: 2 additions & 2 deletions turborepo-tests/integration/tests/run-summary/error.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ that behavior in this test.
$ ${TURBO} run maybefails --filter=my-app --summarize > /dev/null 2>&1
[1]

$ source "$TESTDIR/../_helpers/run-summary-utils.sh"
$ source "$TESTDIR/../../../helpers/utils_run_summary.sh"
$ SUMMARY=$(/bin/ls .turbo/runs/*.json | head -n1)

Validate that there was a failed task and exitCode is 1 (which is what we get from npm for the failed task)
Expand Down Expand Up @@ -91,7 +91,7 @@ Don't use --filter here, so we can validate that both tasks attempted to run
$ ${TURBO} run maybefails --summarize --force --continue > /dev/null 2>&1
[1]

$ source "$TESTDIR/../_helpers/run-summary-utils.sh"
$ source "$TESTDIR/../../../helpers/utils_run_summary.sh"
$ SUMMARY=$(/bin/ls .turbo/runs/*.json | head -n1)

success should be 1, and attempted should be 2
Expand Down
2 changes: 1 addition & 1 deletion turborepo-tests/integration/tests/run-summary/monorepo.t
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Setup
[0-9]+ (re)

# Extract some task-specific summaries from each
$ source "$TESTDIR/../_helpers/run-summary-utils.sh"
$ source "$TESTDIR/../../../helpers/utils_run_summary.sh"
$ FIRST_APP_BUILD=$(getSummaryTaskId "$FIRST" "my-app#build")
$ SECOND_APP_BUILD=$(getSummaryTaskId "$SECOND" "my-app#build")
$ FIRST_UTIL_BUILD=$(getSummaryTaskId "$FIRST" "util#build")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Check
$ ls .turbo/runs/*.json | wc -l
\s*1 (re)

$ source "$TESTDIR/../_helpers/run-summary-utils.sh"
$ source "$TESTDIR/../../../helpers/utils_run_summary.sh"
$ SUMMARY=$(/bin/ls .turbo/runs/*.json | head -n1)
$ TASK_SUMMARY=$(getSummaryTask "$SUMMARY" "build")

Expand Down Expand Up @@ -117,7 +117,7 @@ Check Rust implementation
$ ls .turbo/runs/*.json | wc -l
\s*1 (re)

$ source "$TESTDIR/../_helpers/run-summary-utils.sh"
$ source "$TESTDIR/../../../helpers/utils_run_summary.sh"
$ SUMMARY=$(/bin/ls .turbo/runs/*.json | head -n1)

$ TASK_SUMMARY=$(getSummaryTask "$SUMMARY" "build")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh "with-pkg-deps"
$ source "$TESTDIR/../_helpers/run-summary-utils.sh"
$ source "$TESTDIR/../../../helpers/utils_run_summary.sh"

$ rm -rf .turbo/runs
$ git commit --quiet -am "new sha" --allow-empty && ${TURBO} run build --summarize > /dev/null 2>&1
Expand Down
20 changes: 10 additions & 10 deletions turborepo-tests/integration/tests/run-summary/strict-env.t
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Run as `loose`

All specified + infer
$ rm -rf .turbo/runs
$ ${TESTDIR}/../../../helpers/replace_turbo_config.sh $(pwd) "strict_env_vars/all.json"
$ ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "strict_env_vars/all.json"
$ ${TURBO} run build --summarize > /dev/null
$ cat .turbo/runs/*.json | jq -r '.envMode'
strict
Expand All @@ -66,7 +66,7 @@ All specified + infer

All specified + loose
$ rm -rf .turbo/runs
$ ${TESTDIR}/../../../helpers/replace_turbo_config.sh $(pwd) "strict_env_vars/all.json"
$ ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "strict_env_vars/all.json"
$ ${TURBO} run build --env-mode=loose --summarize > /dev/null
$ cat .turbo/runs/*.json | jq -r '.envMode'
loose
Expand All @@ -82,7 +82,7 @@ All specified + loose

Global passthrough specified empty array + infer
$ rm -rf .turbo/runs
$ ${TESTDIR}/../../../helpers/replace_turbo_config.sh $(pwd) "strict_env_vars/global_pt-empty.json"
$ ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "strict_env_vars/global_pt-empty.json"
$ ${TURBO} run build --summarize > /dev/null
$ cat .turbo/runs/*.json | jq -r '.envMode'
strict
Expand All @@ -96,7 +96,7 @@ Global passthrough specified empty array + infer

Global passthrough specified value + infer
$ rm -rf .turbo/runs
$ ${TESTDIR}/../../../helpers/replace_turbo_config.sh $(pwd) "strict_env_vars/global_pt.json"
$ ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "strict_env_vars/global_pt.json"
$ ${TURBO} run build --summarize > /dev/null
$ cat .turbo/runs/*.json | jq -r '.envMode'
strict
Expand All @@ -110,7 +110,7 @@ Global passthrough specified value + infer

Global passthrough specified empty array + loose
$ rm -rf .turbo/runs
$ ${TESTDIR}/../../../helpers/replace_turbo_config.sh $(pwd) "strict_env_vars/global_pt-empty.json"
$ ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "strict_env_vars/global_pt-empty.json"
$ ${TURBO} run build --env-mode=loose --summarize > /dev/null
$ cat .turbo/runs/*.json | jq -r '.envMode'
loose
Expand All @@ -124,7 +124,7 @@ Global passthrough specified empty array + loose

Global passthrough specified value + loose
$ rm -rf .turbo/runs
$ ${TESTDIR}/../../../helpers/replace_turbo_config.sh $(pwd) "strict_env_vars/global_pt.json"
$ ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "strict_env_vars/global_pt.json"
$ ${TURBO} run build --env-mode=loose --summarize > /dev/null
$ cat .turbo/runs/*.json | jq -r '.envMode'
loose
Expand All @@ -138,7 +138,7 @@ Global passthrough specified value + loose

Task passthrough specified empty array + infer
$ rm -rf .turbo/runs
$ ${TESTDIR}/../../../helpers/replace_turbo_config.sh $(pwd) "strict_env_vars/task_pt-empty.json"
$ ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "strict_env_vars/task_pt-empty.json"
$ ${TURBO} run build --summarize > /dev/null
$ cat .turbo/runs/*.json | jq -r '.envMode'
infer
Expand All @@ -152,7 +152,7 @@ Task passthrough specified empty array + infer

Task passthrough specified value + infer
$ rm -rf .turbo/runs
$ ${TESTDIR}/../../../helpers/replace_turbo_config.sh $(pwd) "strict_env_vars/task_pt.json"
$ ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "strict_env_vars/task_pt.json"
$ ${TURBO} run build --summarize > /dev/null
$ cat .turbo/runs/*.json | jq -r '.envMode'
infer
Expand All @@ -168,7 +168,7 @@ Task passthrough specified value + infer

Task passthrough specified empty array + loose
$ rm -rf .turbo/runs
$ ${TESTDIR}/../../../helpers/replace_turbo_config.sh $(pwd) "strict_env_vars/task_pt-empty.json"
$ ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "strict_env_vars/task_pt-empty.json"
$ ${TURBO} run build --env-mode=loose --summarize > /dev/null
$ cat .turbo/runs/*.json | jq -r '.envMode'
loose
Expand All @@ -182,7 +182,7 @@ Task passthrough specified empty array + loose

Task passthrough specified value + loose
$ rm -rf .turbo/runs
$ ${TESTDIR}/../../../helpers/replace_turbo_config.sh $(pwd) "strict_env_vars/task_pt.json"
$ ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "strict_env_vars/task_pt.json"
$ ${TURBO} run build --env-mode=loose --summarize > /dev/null
$ cat .turbo/runs/*.json | jq -r '.envMode'
loose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Choose our custom config based on OS, since the input/output configs will be dif
$ [[ "$OSTYPE" == "msys" ]] && CONFIG="abs-path-globs-win.json" || CONFIG="abs-path-globs.json"

Copy config into the root of our monrepo
$ ${TESTDIR}/../../../helpers/replace_turbo_config.sh $PWD $CONFIG
$ ${TESTDIR}/../../../helpers/replace_turbo_json.sh $PWD $CONFIG

Only check contents that comes after the warning prefix
We omit duplicates as Go with debug assertions enabled parses turbo.json twice
Expand Down
4 changes: 2 additions & 2 deletions turborepo-tests/integration/tests/run/gitignored-inputs.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Setup
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh

Use our custom turbo config which has foo.txt as an input to the build command
$ . ${TESTDIR}/../../../helpers/replace_turbo_config.sh $(pwd) "gitignored-inputs.json"
$ . ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "gitignored-inputs.json"

Create a internal.txt for the util package and add it to gitignore
This field is already part of our turbo config.
Expand All @@ -12,7 +12,7 @@ This field is already part of our turbo config.
$ git add . && git commit --quiet -m "add internal.txt"

Some helper functions to parse the summary file
$ source "$TESTDIR/../_helpers/run-summary-utils.sh"
$ source "$TESTDIR/../../../helpers/utils_run_summary.sh"

Just run the util package, it's simpler
$ ${TURBO} run build --filter=util --output-logs=hash-only --summarize | grep "util:build: cache"
Expand Down
2 changes: 1 addition & 1 deletion turborepo-tests/integration/tests/spaces-failure.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh
$ . ${TESTDIR}/../../helpers/replace_turbo_config.sh $(pwd) spaces-failure.json
$ . ${TESTDIR}/../../helpers/replace_turbo_json.sh $(pwd) spaces-failure.json

Ensures that even when spaces fails, the build still succeeds.
$ ${TURBO} run build --token foobarbaz --team bat --api https://example.com > /dev/null 2>&1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Empty passthroughs are null
}

Make sure that we populate the JSON output
$ ${TESTDIR}/../../../helpers/replace_turbo_config.sh $(pwd) "strict_env_vars/all.json"
$ ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "strict_env_vars/all.json"
$ ${TURBO} build --dry=json | jq -r '.tasks[0].environmentVariables | { passthrough, globalPassthrough }'
{
"passthrough": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ Setup
With --env-mode=infer

Baseline global hash
$ BASELINE=$(${TURBO} build -vv 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh")
$ BASELINE=$(${TURBO} build -vv 2>&1 | "$TESTDIR/../../../helpers/find_global_hash.sh")

There's no config to start, so the global hash does not change when flag is passed
$ WITH_FLAG=$(${TURBO} build -vv --env-mode=infer 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh")
$ WITH_FLAG=$(${TURBO} build -vv --env-mode=infer 2>&1 | "$TESTDIR/../../../helpers/find_global_hash.sh")
$ test $BASELINE = $WITH_FLAG

Add empty config for global pass through env var, global hash changes
$ ${TESTDIR}/../../../helpers/replace_turbo_config.sh $(pwd) "strict_env_vars/global_pt-empty.json"
$ WITH_EMPTY_GLOBAL=$(${TURBO} build -vv --env-mode=infer 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh")
$ ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "strict_env_vars/global_pt-empty.json"
$ WITH_EMPTY_GLOBAL=$(${TURBO} build -vv --env-mode=infer 2>&1 | "$TESTDIR/../../../helpers/find_global_hash.sh")
$ test $BASELINE != $WITH_EMPTY_GLOBAL

Add global pass through env var, global hash changes again, because we changed the value
$ ${TESTDIR}/../../../helpers/replace_turbo_config.sh $(pwd) "strict_env_vars/global_pt.json"
$ WITH_GLOBAL=$(${TURBO} build -vv --env-mode=infer 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh")
$ ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "strict_env_vars/global_pt.json"
$ WITH_GLOBAL=$(${TURBO} build -vv --env-mode=infer 2>&1 | "$TESTDIR/../../../helpers/find_global_hash.sh")
$ test $WITH_EMPTY_GLOBAL != $WITH_GLOBAL
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ Setup
With --env-mode=loose

Baseline global hash
$ BASELINE=$(${TURBO} build -vv 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh")
$ BASELINE=$(${TURBO} build -vv 2>&1 | "$TESTDIR/../../../helpers/find_global_hash.sh")

Hash changes, because we're using a new mode
$ WITH_FLAG=$(${TURBO} build -vv --env-mode=loose 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh")
$ WITH_FLAG=$(${TURBO} build -vv --env-mode=loose 2>&1 | "$TESTDIR/../../../helpers/find_global_hash.sh")
$ test $BASELINE != $WITH_FLAG

Add empty config for global pass through env var
Hash does not change, because in loose mode, we don't care what the actual config contains
$ ${TESTDIR}/../../../helpers/replace_turbo_config.sh $(pwd) "strict_env_vars/global_pt-empty.json"
$ WITH_EMPTY_GLOBAL=$(${TURBO} build -vv --env-mode=loose 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh")
$ ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "strict_env_vars/global_pt-empty.json"
$ WITH_EMPTY_GLOBAL=$(${TURBO} build -vv --env-mode=loose 2>&1 | "$TESTDIR/../../../helpers/find_global_hash.sh")
$ test $WITH_FLAG = $WITH_EMPTY_GLOBAL

Add global pass through env var
Hash does not change, because in loose mode, we don't care what the actual config contains
$ ${TESTDIR}/../../../helpers/replace_turbo_config.sh $(pwd) "strict_env_vars/global_pt.json"
$ WITH_GLOBAL=$(${TURBO} build -vv --env-mode=loose 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh")
$ ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "strict_env_vars/global_pt.json"
$ WITH_GLOBAL=$(${TURBO} build -vv --env-mode=loose 2>&1 | "$TESTDIR/../../../helpers/find_global_hash.sh")
$ test $WITH_FLAG = $WITH_GLOBAL
$ test $WITH_EMPTY_GLOBAL = $WITH_GLOBAL
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ Setup
With --env-mode (should be the same as --env-mode=infer)

Baseline global hash
$ BASELINE=$(${TURBO} build -vv 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh")
$ BASELINE=$(${TURBO} build -vv 2>&1 | "$TESTDIR/../../../helpers/find_global_hash.sh")

There's no config to start, so the global hash does not change when flag is passed
$ WITH_FLAG=$(${TURBO} build -vv --env-mode 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh")
$ WITH_FLAG=$(${TURBO} build -vv --env-mode 2>&1 | "$TESTDIR/../../../helpers/find_global_hash.sh")
$ test $BASELINE = $WITH_FLAG

Add empty config for global pass through env var, global hash changes
$ ${TESTDIR}/../../../helpers/replace_turbo_config.sh $(pwd) "strict_env_vars/global_pt-empty.json"
$ WITH_EMPTY_GLOBAL=$(${TURBO} build -vv --env-mode 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh")
$ ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "strict_env_vars/global_pt-empty.json"
$ WITH_EMPTY_GLOBAL=$(${TURBO} build -vv --env-mode 2>&1 | "$TESTDIR/../../../helpers/find_global_hash.sh")
$ test $BASELINE != $WITH_EMPTY_GLOBAL

Add global pass through env var, global hash changes again, because we changed the value
$ ${TESTDIR}/../../../helpers/replace_turbo_config.sh $(pwd) "strict_env_vars/global_pt.json"
$ WITH_GLOBAL=$(${TURBO} build -vv --env-mode 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh")
$ ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "strict_env_vars/global_pt.json"
$ WITH_GLOBAL=$(${TURBO} build -vv --env-mode 2>&1 | "$TESTDIR/../../../helpers/find_global_hash.sh")
$ test $WITH_EMPTY_GLOBAL != $WITH_GLOBAL
Loading

0 comments on commit e5d7b86

Please sign in to comment.