Compare commits

...

4 Commits

Author SHA1 Message Date
Denis Bilenko e866216697
Merge b66dfa3fa2 into f2096eddcc 2025-02-11 01:55:16 -08:00
Denis Bilenko f2096eddcc
acc: Do not show all replacements on every failure (#2331)
## Changes
- Only print replacements if VERBOSE_TEST flag is set.
- This is set on CI but not when you do "go test" or "make test".

Note, env var is used, so that it can be set in Makefile.

## Tests
Manually.
2025-02-11 09:38:53 +00:00
Denis Bilenko b66dfa3fa2 go test -update 2025-02-10 12:45:46 +01:00
Denis Bilenko 618b93c234 Enable standard templates on cloud 2025-02-10 12:45:02 +01:00
9 changed files with 36 additions and 17 deletions

View File

@ -28,7 +28,7 @@ test:
cover:
rm -fr ./acceptance/build/cover/
CLI_GOCOVERDIR=build/cover ${GOTESTSUM_CMD} -- -coverprofile=coverage.txt ${PACKAGES}
VERBOSE_TEST=1 CLI_GOCOVERDIR=build/cover ${GOTESTSUM_CMD} -- -coverprofile=coverage.txt ${PACKAGES}
rm -fr ./acceptance/build/cover-merged/
mkdir -p acceptance/build/cover-merged/
go tool covdata merge -i $$(printf '%s,' acceptance/build/cover/* | sed 's/,$$//') -o acceptance/build/cover-merged/
@ -61,6 +61,6 @@ integration: vendor
$(INTEGRATION)
integration-short: vendor
$(INTEGRATION) -short
VERBOSE_TEST=1 $(INTEGRATION) -short
.PHONY: lint tidy lintcheck fmt test cover showcover build snapshot vendor schema integration integration-short acc-cover acc-showcover docs

View File

@ -30,8 +30,9 @@ import (
)
var (
KeepTmp bool
NoRepl bool
KeepTmp bool
NoRepl bool
VerboseTest bool = os.Getenv("VERBOSE_TEST") != ""
)
// In order to debug CLI running under acceptance test, set this to full subtest name, e.g. "bundle/variables/empty"
@ -412,7 +413,7 @@ func doComparison(t *testing.T, repls testdiff.ReplacementsContext, dirRef, dirN
testutil.WriteFile(t, pathRef, valueNew)
}
if !equal && printedRepls != nil && !*printedRepls {
if VerboseTest && !equal && printedRepls != nil && !*printedRepls {
*printedRepls = true
var items []string
for _, item := range repls.Repls {

View File

@ -28,7 +28,7 @@ targets:
# We explicitly specify /Workspace/Users/[USERNAME] to make sure we only have a single copy.
root_path: /Workspace/Users/[USERNAME]/.bundle/${bundle.name}/${bundle.target}
permissions:
- user_name: [USERNAME]
- $USER_NAME_KEY: [USERNAME]
level: CAN_MANAGE
run_as:
user_name: [USERNAME]
$USER_NAME_KEY: [USERNAME]

View File

@ -33,7 +33,7 @@ resources:
new_cluster:
spark_version: 15.4.x-scala2.12
node_type_id: i3.xlarge
node_type_id: (redacted)
data_security_mode: SINGLE_USER
num_workers: 0
spark_conf:

View File

@ -25,7 +25,7 @@ targets:
# We explicitly specify /Workspace/Users/[USERNAME] to make sure we only have a single copy.
root_path: /Workspace/Users/[USERNAME]/.bundle/${bundle.name}/${bundle.target}
permissions:
- user_name: [USERNAME]
- $USER_NAME_KEY: [USERNAME]
level: CAN_MANAGE
run_as:
user_name: [USERNAME]
$USER_NAME_KEY: [USERNAME]

View File

@ -43,7 +43,7 @@ resources:
- job_cluster_key: job_cluster
new_cluster:
spark_version: 15.4.x-scala2.12
node_type_id: i3.xlarge
node_type_id: (redacted)
autoscale:
min_workers: 1
max_workers: 4

View File

@ -42,7 +42,7 @@ targets:
catalog: main
schema: default
permissions:
- user_name: [USERNAME]
- $USER_NAME_KEY: [USERNAME]
level: CAN_MANAGE
run_as:
user_name: [USERNAME]
$USER_NAME_KEY: [USERNAME]

View File

@ -43,7 +43,7 @@ targets:
# We explicitly specify /Workspace/Users/[USERNAME] to make sure we only have a single copy.
root_path: /Workspace/Users/[USERNAME]/.bundle/${bundle.name}/${bundle.target}
permissions:
- user_name: [USERNAME]
- $USER_NAME_KEY: [USERNAME]
level: CAN_MANAGE
run_as:
user_name: [USERNAME]
$USER_NAME_KEY: [USERNAME]

View File

@ -1,2 +1,20 @@
# At the moment, there are many differences across different envs w.r.t to catalog use, node type and so on.
LocalOnly = true
[[Repls]]
Old = 'service_principal_name:'
New = '$$USER_NAME_KEY:'
[[Repls]]
Old = 'user_name:'
New = '$$USER_NAME_KEY:'
[[Repls]]
Old = '''
email_notifications:
on_failure:
- \$USERNAME
'''
New = ''
[[Repls]]
Old = '\bnode_type_id: [0-9a-zA-Z_.-]+\b'
New = 'node_type_id: (redacted)'