Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added test for negation pattern in sync include exclude section #1637

Merged
merged 6 commits into from
Jul 31, 2024

Conversation

andrewnester
Copy link
Contributor

Changes

Added test for negation pattern in sync include exclude section

bundle/config/validate/validate_sync_patterns.go Outdated Show resolved Hide resolved
@@ -67,6 +67,9 @@ func setupFiles(t *testing.T) string {
err = createFile(sub2, "g.go")
require.NoError(t, err)

err = createFile(sub2, "h.txt")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend creating these files and directories using for loops, to make the code terser.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shreyas-goenka we can't really because we need predictable structure and the files are located in different subdirectories so using loops will make it even less readable

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about simplifying it like this? The file tree structure is a lot more evident in this case.

for p in {
  []string{dir, "a.go"},
  []string{dir, "b.go"},
  ...
  []string{dir, ".databricks", "e.go"}
  ...
  []string{dir, "test", "sub1", "f.go"}
} {
  testutil.Touch(t, p...)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's a good one, thanks!

libs/sync/sync_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@shreyas-goenka shreyas-goenka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good to me! Approving to unblock.

bundle/config/validate/validate_sync_patterns.go Outdated Show resolved Hide resolved
@andrewnester andrewnester added this pull request to the merge queue Jul 31, 2024
Merged via the queue into main with commit 1fb8e32 Jul 31, 2024
5 checks passed
@andrewnester andrewnester deleted the fix/include-negation branch July 31, 2024 13:52
andrewnester added a commit that referenced this pull request Jul 31, 2024
Bundles:
 * Add resource for UC schemas to DABs ([#1413](#1413)).

Internal:
 * Use dynamic walking to validate unique resource keys ([#1614](#1614)).
 * Regenerate TF schema ([#1635](#1635)).
 * Add upgrade and upgrade eager flags to pip install call ([#1636](#1636)).
 * Added test for negation pattern in sync include exclude section ([#1637](#1637)).
 * Use precomputed terraform plan for `bundle deploy` ([#1640](#1640)).
@andrewnester andrewnester mentioned this pull request Jul 31, 2024
github-merge-queue bot pushed a commit that referenced this pull request Jul 31, 2024
Bundles:
* Add resource for UC schemas to DABs
([#1413](#1413)).

Internal:
* Use dynamic walking to validate unique resource keys
([#1614](#1614)).
* Regenerate TF schema
([#1635](#1635)).
* Add upgrade and upgrade eager flags to pip install call
([#1636](#1636)).
* Added test for negation pattern in sync include exclude section
([#1637](#1637)).
* Use precomputed terraform plan for `bundle deploy`
([#1640](#1640)).
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.

2 participants