-
Notifications
You must be signed in to change notification settings - Fork 251
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
Samples: add automated test to sample 04.0-file-transfer #1565
Samples: add automated test to sample 04.0-file-transfer #1565
Conversation
* add missing sample output to README.md * add missing property `edctype` to filetransfer.json * add missing toBuilder() method to DataRequest.java * add missing toBuilder() method to DataAddress.java * cache value for build root * test: add unit tests: verifyCopy, verifyDeepCopy, verifyToBuilder
Codecov Report
@@ Coverage Diff @@
## main #1565 +/- ##
==========================================
+ Coverage 67.63% 67.93% +0.30%
==========================================
Files 739 739
Lines 16250 16259 +9
Branches 1062 1064 +2
==========================================
+ Hits 10990 11046 +56
+ Misses 4780 4733 -47
Partials 480 480
Continue to review full report at Codecov.
|
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 don't understand why the changes to DataRequest
and DataAddress
are necessary. The changes also modifies behaviour (e.g. properties
).
@paullatzelsperger wrote:
The changes in With changed behaviour you mean the use of Apart from that I don't see changed behavior. Let me know if you see more. |
We won't add code to a class simply to make instantiating it in tests easier. If copying a data class is desired, then please add a utility method to that test.
I'm not talking about nullchecks or optimizations. public Builder properties(Map<String, String> value) {
request.properties = value;
return this;
} I would say that's a definite change in behaviour that is not desired at this time. |
+ restore previous behavior for Builder.properties()
+ restore previous behavior for Builder.properties()
I see the point in scope creep here. I have moved the copy code into the test. However, I have kept a fix and additional unit tests for
Indeed, this change in behavior was not intended. Reverted. |
One more time: we do not need/want the If anything, |
Newly introduced
I have removed the fix from |
* @throws IOException Thrown if there was an error accessing the transfer request file defined in {@link FileTransferSampleTest#TRANSFER_FILE_PATH}. | ||
*/ | ||
void requestTransferFile() throws IOException { | ||
File transferJsonFile = getFileFromRelativePath(TRANSFER_FILE_PATH); |
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.
Please use var
What this PR changes/adds
Automated integration tests that run in CI should be added for samples to prevent the samples breaking due to changes in the EDC. The scope of this story is to add automated integration tests for sample 04.0.
FileTransferSampleTest.java
samples/04.0-file-transfer/README.md
with missing sample outputWhy it does that
Every step from sample readme is reproduced in the automated tests to reduce the risk from sample guidance diverging from actual code base.
Further notes
samples/04.0-file-transfer/filetransfer.json
was missingedctype
set todataspaceconnector:datarequest
FsConfigurationExtension.java
to allow multipleEdcRuntimeExtension
instances which load configuration from filesystemAzureDataFactoryTransferIntegrationTest.java
to replicate previous behavior ofFsConfigurationExtension.java
. Without this change the checkTest Code (Style, Tests) / Azure-Cloud-Integration-Test
would fail.Linked Issue(s)
Closes #1269
Checklist
no-changelog
)