Skip to content

Commit 48e647c

Browse files
Improve PyDABs acceptance test consistency error (#3874)
## Changes The PyDABs consistency acceptance test now shows actionable errors. This PR also removes the unnecessary second test pass from `make test-update-templates`. **Before:** When there is an inconsistency between the yml version and .py version of the `default` template we'd get a diff like this: ``` $ make test [...] >>> diff -Naur enable_pydabs=yes enable_pydabs=no --- enable_pydabs=yes +++ enable_pydabs=no @@ -101,7 +101,6 @@ "pipelines": { "my_pydabs_etl": { - "catalog": "hive_metastore", [... 10+ more times with different line numbers like @@ -72,7... @@ -60,7... etc ...] ``` **After:** Such an inconsistency comes with a more actionable error: ``` ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ❌ PyDABs Template Consistency Check Failed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Python and YAML resource templates are generating different configurations! 📁 Check ALL template files in: libs/template/templates/default/template/{{.project_name}}/resources/ • *.py.tmpl (Python resource definitions) • *.yml.tmpl (YAML resource definitions) 💡 Steps to fix: 1. Look at the diff above to identify which field differs 2. Find which *.py.tmpl file contains that field 3. Compare it to the corresponding *.yml.tmpl file 4. Ensure the field has the same active/commented state in both formats ``` ## Why Template inconsistencies produced cryptic diffs with no context. Second test pass was cargo-culted from `test-update` but does nothing. ## Tests Manual verification with intentional template inconsistency
1 parent 090a9ca commit 48e647c

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ test-update:
6767
# Updates acceptance test output for template tests only
6868
test-update-templates:
6969
-go test ./acceptance -run '^TestAccept/bundle/templates' -update -timeout=${LOCAL_TIMEOUT}
70-
@# at the moment second pass is required because some tests show diff against output of another test for easier review
71-
-go test ./acceptance -run '^TestAccept/bundle/templates' -update -timeout=${LOCAL_TIMEOUT}
7270

7371
# Updates acceptance test output (integration tests, requires access)
7472
test-update-aws:

acceptance/bundle/templates/pydabs/check-consistency/script

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,30 @@ for enable_pydabs in yes no; do
1717
rm -rf my_pydabs input.json
1818
done
1919

20-
trace diff -Naur enable_pydabs=yes enable_pydabs=no
20+
if ! trace diff -Naur enable_pydabs=yes enable_pydabs=no; then
21+
cat <<'EOF'
22+
23+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
24+
❌ PyDABs Template Consistency Check Failed
25+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
26+
27+
Python and YAML resource templates are generating different configurations!
28+
29+
📁 Check ALL template files in:
30+
libs/template/templates/default/template/{{.project_name}}/resources/
31+
• *.py.tmpl (Python resource definitions)
32+
• *.yml.tmpl (YAML resource definitions)
33+
34+
🐛 Example issue: Field is ACTIVE in one format but COMMENTED in the other
35+
"catalog": "${var.catalog}" vs # "catalog": "${var.catalog}"
36+
37+
💡 Steps to fix:
38+
1. Look at the diff above to identify which field differs
39+
2. Find which *.py.tmpl file contains that field
40+
3. Compare it to the corresponding *.yml.tmpl file
41+
4. Ensure the field has the same active/commented state in both formats
42+
43+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
44+
EOF
45+
fi
2146
rm enable_pydabs=yes enable_pydabs=no

0 commit comments

Comments
 (0)