Skip to content

Commit

Permalink
Merge pull request GoogleCloudPlatform#2446 from yuwenma/storagenotif…
Browse files Browse the repository at this point in the history
…ication-1

feat: Add basic/full test suite for storageNotification
  • Loading branch information
google-oss-prow[bot] authored Aug 8, 2024
2 parents ceccc2c + 1571eda commit 2dee76e
Show file tree
Hide file tree
Showing 9 changed files with 1,440 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/test/constants/presubmitconstants_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestValidTestName(t *testing.T) {
return nil
}
// Test cases are the names of the leaf-node directory, only match on the lowest subdirectory name
if strings.HasSuffix(filepath.Dir(path), tc) {
if strings.Contains(filepath.Dir(path), tc) {
found = true
return nil
}
Expand All @@ -104,6 +104,7 @@ func TestValidTestName(t *testing.T) {
}
}
}

func TestGetPresubmitLiteRegexString(t *testing.T) {
s := GetPresubmitLiteRegexStringArray()
// Check if string slice contains any test cases from the long running or
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: storage.cnrm.cloud.google.com/v1beta1
kind: StorageNotification
metadata:
annotations:
cnrm.cloud.google.com/management-conflict-prevention-policy: none
cnrm.cloud.google.com/state-into-spec: merge
finalizers:
- cnrm.cloud.google.com/finalizer
- cnrm.cloud.google.com/deletion-defender
generation: 2
labels:
cnrm-test: "true"
name: storagenotification-${uniqueId}
namespace: ${uniqueId}
spec:
bucketRef:
name: storagebucket-${uniqueId}
payloadFormat: JSON_API_V1
resourceID: "1"
topicRef:
name: pubsubtopic-${uniqueId}
status:
conditions:
- lastTransitionTime: "1970-01-01T00:00:00Z"
message: The resource is up to date
reason: UpToDate
status: "True"
type: Ready
notificationId: "1"
observedGeneration: 2
selfLink: https://www.googleapis.com/storage/v1/b/storagebucket-${uniqueId}/notificationConfigs/1
Loading

0 comments on commit 2dee76e

Please sign in to comment.