-
Notifications
You must be signed in to change notification settings - Fork 32
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
Sftp writes should truncate 154 #155
Conversation
@@ -914,7 +861,7 @@ func (s *vfsTestSuite) File(baseLoc vfs.Location) { | |||
// gs-specific test cases | |||
func (s *vfsTestSuite) gsList(baseLoc vfs.Location) { | |||
/* | |||
test scenario: | |||
test description: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only moved contents of this file to common.go.
"github.com/c2fo/vfs/v6/vfssimple" | ||
) | ||
|
||
type OSWrapper struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OSWrapper implements ReadWriteSeekCloseURINamer used by this test to generically test io functionality for vfs.File implemenations. However, I needed a baseline to model the tests on so this basically provides an unix os file interface (outside of the os backend) to ensure we're following those io behaviors.
false, | ||
"new text", | ||
}, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests cases use a mini-DSL to perform read/write/seek/close functions in various sequences. It was surprising how little the SFTP implementation had a to change to match the tests. Basically, only changes to a couple of flags and (making Read() and Write() use RW (vs read-only or write-only), and the conditional Truncate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I like the repeatable nature of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be missing some context around how these get executed. Is it expected that contributors add test cases here, or do we expect contributors to run this test suite specifically? Our README doc doesn't really call out how to perform integration tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I actually built these tests as part of a different PR for S3 streaming (vs saving to memory) but needed to "know" how to handle various sequences first. My intent is to add each backend to the CI (with gh secrets). Locally, you can run it the same way you do with the earlier (spaghetti-like) backend integration tests.
See https://github.com/C2FO/vfs/blob/master/backend/testsuite/doc.go
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #155 +/- ##
==========================================
+ Coverage 71.60% 71.66% +0.06%
==========================================
Files 40 40
Lines 4628 4638 +10
==========================================
+ Hits 3314 3324 +10
Misses 1043 1043
Partials 271 271 ☔ View full report in Codecov by Sentry. |
No description provided.