databricks-cli/bundle/run
Pieter Noordhuis 70b7bbfd81
Remove calls to `t.Setenv` from integration tests (#2018)
## Changes

The `Setenv` helper function configures an environment variable and
resets it to its original value when exiting the test scope. It is
incompatible with running tests in parallel because it modifies
process-wide state. The `libs/env` package defines functions to interact
with the environment but records `Setenv` calls on a `context.Context`.
This enables us to override/specialize the environment scoped to a
context.

Pre-requisites for removing the `t.Setenv` calls:
* Make `cmdio.NewIO` accept a context and use it with `libs/env`
* Make all `internal/testcli` functions use a context

The rest of this change:
* Modifies integration tests to initialize a context to use if there
wasn't already one
* Updates `t.Setenv` calls to use `env.Set`

## Tests

n/a
2024-12-16 12:34:37 +01:00
..
output Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
progress Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
args.go Processing and completion of positional args to bundle run (#1120) 2024-04-22 11:50:13 +00:00
args_test.go Processing and completion of positional args to bundle run (#1120) 2024-04-22 11:50:13 +00:00
job.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
job_args.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
job_args_test.go Processing and completion of positional args to bundle run (#1120) 2024-04-22 11:50:13 +00:00
job_options.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
job_options_test.go Group bundle run flags by job and pipeline types (#1174) 2024-02-06 14:51:02 +00:00
job_test.go Remove calls to `t.Setenv` from integration tests (#2018) 2024-12-16 12:34:37 +01:00
options.go Make sure grouped flags are added to the command flag set (#1180) 2024-02-07 10:27:13 +00:00
pipeline.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
pipeline_options.go Add `--validate-only` flag to run validate-only pipeline update (#1251) 2024-03-04 08:38:32 +00:00
pipeline_options_test.go Add `--validate-only` flag to run validate-only pipeline update (#1251) 2024-03-04 08:38:32 +00:00
pipeline_test.go Remove calls to `t.Setenv` from integration tests (#2018) 2024-12-16 12:34:37 +01:00
runner.go Reuse resource resolution code for the run command (#1858) 2024-10-24 13:24:30 +00:00
runner_test.go Reuse resource resolution code for the run command (#1858) 2024-10-24 13:24:30 +00:00