PoC: add context files blind test#4799
Conversation
|
@copilot review changes in this PR |
There was a problem hiding this comment.
Pull request overview
Adds default keyspace filtering to exclude temporary keyspaces and introduces an integration test to validate that tmp* keyspaces are not included in backup targets.
Changes:
- Set default backup task keyspace patterns to include all keyspaces except those matching
tmp*. - Add an integration test verifying
GetTargetexcludestmp*keyspaces even when requested.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/service/backup/service_backup_integration_test.go | Adds an integration test asserting tmp* keyspaces are excluded from backup targets. |
| pkg/service/backup/model.go | Changes default task properties to filter out tmp* keyspaces by default. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| } | ||
|
|
||
| func TestTmpKsIntegration(t *testing.T) { |
There was a problem hiding this comment.
The test name is ambiguous and uses an abbreviation (TmpKs) that doesn’t describe the behavior under test. Consider renaming to something behavior-focused like TestBackupGetTargetExcludesTmpKeyspaces (or similar), so failures are easier to interpret in CI output.
| func TestTmpKsIntegration(t *testing.T) { | |
| func TestBackupGetTargetExcludesTmpKeyspacesIntegration(t *testing.T) { |
| Transfers: scyllaclient.TransfersFromConfig, | ||
| Method: MethodRclone, | ||
| Continue: true, | ||
| Keyspace: []string{"*", "!tmp*"}, |
There was a problem hiding this comment.
Changing the default keyspace selection to ["*", "!tmp*"] introduces a behavior change: tmp* keyspaces will be excluded by default system-wide, potentially even when a caller explicitly requests them (as the new integration test appears to verify). If this is intended policy, it should be explicitly documented and ideally configurable; if not intended, consider applying the exclusion only when the user does not provide a keyspace property (i.e., treat it as a default rather than an override).
| Keyspace: []string{"*", "!tmp*"}, | |
| Keyspace: []string{"*"}, |
There was a problem hiding this comment.
they won't be excluded when explicitly requested
| testBucket = "backuptest-tmpks" | ||
| testKeyspaceRegular = "ks" | ||
| testKeyspaceTmp = "tmpks" | ||
| ) | ||
|
|
There was a problem hiding this comment.
Using a fixed bucket name (and very generic keyspace names) can cause collisions or cross-test interference when tests run concurrently or reuse shared infrastructure (e.g., shared MinIO/S3 or shared clusters). Prefer generating unique names per test run (e.g., include t.Name() and a random/UUID suffix) to improve isolation and reduce flakes.
| testBucket = "backuptest-tmpks" | |
| testKeyspaceRegular = "ks" | |
| testKeyspaceTmp = "tmpks" | |
| ) | |
| testKeyspaceRegular = "ks" | |
| testKeyspaceTmp = "tmpks" | |
| ) | |
| testBucket := fmt.Sprintf("backuptest-tmpks-%d", time.Now().UnixNano()) |
There was a problem hiding this comment.
ok nitpick
Here's my review of the changes:
|
No description provided.