Only select a test file if it's not empty (#3483)
This is to protect against accidentally selecting a zero sized file for item read tests. This may happen if another CI test is running in parallel which creates a bunch of empty files in the same drive. --- #### Does this PR need a docs update or release note? - [ ] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [x] ⛔ No #### Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [x] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Supportability/Tests - [ ] 💻 CI/Deployment - [ ] 🧹 Tech Debt/Cleanup #### Issue(s) <!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. --> * #<issue> #### Test Plan <!-- How will this be tested prior to merging.--> - [ ] 💪 Manual - [ ] ⚡ Unit test - [x] 💚 E2E
This commit is contained in:
parent
d0354a9971
commit
bdebaa5f29
@ -68,7 +68,8 @@ func (suite *ItemIntegrationSuite) TestItemReader_oneDrive() {
|
|||||||
defer flush()
|
defer flush()
|
||||||
|
|
||||||
var driveItem models.DriveItemable
|
var driveItem models.DriveItemable
|
||||||
// This item collector tries to find "a" drive item that is a file to test the reader function
|
// This item collector tries to find "a" drive item that is a non-empty
|
||||||
|
// file to test the reader function
|
||||||
itemCollector := func(
|
itemCollector := func(
|
||||||
_ context.Context,
|
_ context.Context,
|
||||||
_, _ string,
|
_, _ string,
|
||||||
@ -81,7 +82,7 @@ func (suite *ItemIntegrationSuite) TestItemReader_oneDrive() {
|
|||||||
_ *fault.Bus,
|
_ *fault.Bus,
|
||||||
) error {
|
) error {
|
||||||
for _, item := range items {
|
for _, item := range items {
|
||||||
if item.GetFile() != nil {
|
if item.GetFile() != nil && ptr.Val(item.GetSize()) > 0 {
|
||||||
driveItem = item
|
driveItem = item
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user