Skip to content
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: 04.1-file-transfer-listener: add automated test in sample 04.1 #317

Conversation

pkirch
Copy link

@pkirch pkirch commented Jul 1, 2022

What this PR changes/adds

This PR adds automated integration tests that run in CI 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.1.

  • Added test class FileTransferListenerSampleTest.java.

Why 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

  • Link to successful CI test run from commit 98bf278
  • Updated samples/04.1-file-transfer-listener/README.md fixing changed references.
  • No update to changelog as these changes apply to samples.

Linked Issue(s)

Predecessor: #319
Closes #254

Checklist

  • added appropriate tests?
  • performed checkstyle check locally?
  • added/updated copyright headers?
  • documented public classes/methods?
  • added/updated relevant documentation?
  • added relevant details to the changelog? (skip with label no-changelog)
  • formatted title correctly? (take a look at the CONTRIBUTING and styleguide for details)

pkirch added 2 commits July 1, 2022 15:10
* reused from branch feature/1269-automated-tests-sample-040
* adjusted to module :samples:04.1-file-transfer-listener:integration-tests
@pkirch pkirch added the no-changelog Used for a workflow label Jul 1, 2022
@pkirch pkirch self-assigned this Jul 1, 2022
@pkirch pkirch linked an issue Jul 1, 2022 that may be closed by this pull request
5 tasks
@pkirch pkirch temporarily deployed to Azure-dev July 4, 2022 12:52 Inactive
@pkirch pkirch temporarily deployed to Azure-dev July 4, 2022 12:55 Inactive
@github-actions
Copy link

github-actions bot commented Jul 4, 2022

Unit Test Results

     430 files  +1       430 suites  +1   21m 17s ⏱️ + 1m 6s
12 468 tests ±0  12 454 ✔️ ±0  14 💤 ±0  0 ±0 
12 536 runs  +1  12 522 ✔️ +1  14 💤 ±0  0 ±0 

Results for commit c9ce65f. ± Comparison against base commit 08b84be.

♻️ This comment has been updated with latest results.

@pkirch pkirch temporarily deployed to Azure-dev July 4, 2022 14:19 Inactive
@pkirch pkirch temporarily deployed to Azure-dev July 4, 2022 14:19 Inactive
@codecov-commenter
Copy link

codecov-commenter commented Jul 4, 2022

Codecov Report

Merging #317 (c9ce65f) into feature/1535-automated-tests-sample-041 (08b84be) will not change coverage.
The diff coverage is n/a.

@@                           Coverage Diff                            @@
##           feature/1535-automated-tests-sample-041     #317   +/-   ##
========================================================================
  Coverage                                    67.31%   67.31%           
========================================================================
  Files                                          771      771           
  Lines                                        16599    16599           
  Branches                                      1050     1050           
========================================================================
  Hits                                         11173    11173           
  Misses                                        4945     4945           
  Partials                                       481      481           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 08b84be...c9ce65f. Read the comment docs.

@pkirch pkirch temporarily deployed to Azure-dev July 5, 2022 10:42 Inactive
@pkirch pkirch temporarily deployed to Azure-dev July 5, 2022 10:45 Inactive
@pkirch pkirch mentioned this pull request Jul 5, 2022
7 tasks
@pkirch pkirch temporarily deployed to Azure-dev July 5, 2022 13:15 Inactive
@pkirch pkirch temporarily deployed to Azure-dev July 5, 2022 13:16 Inactive
@pkirch pkirch temporarily deployed to Azure-dev July 6, 2022 08:10 Inactive
@pkirch pkirch temporarily deployed to Azure-dev July 7, 2022 09:18 Inactive
@pkirch pkirch temporarily deployed to Azure-dev July 7, 2022 09:21 Inactive
…-test-400' into feature/1535/254-automated-test-sample-041

# Conflicts:
#	samples/04.0-file-transfer/integration-tests/src/testFixtures/java/org/eclipse/dataspaceconnector/extension/sample/test/FileTransferSampleTestCommon.java
public static int getInt(@NotNull DescriptionRequestMessage message, String propertyName, int defaultValue) {
return ofNullable(message.getProperties())
.map(map -> map.get(propertyName))
.map(v -> Integer.parseInt(v.toString()))

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException

Potential uncaught 'java.lang.NumberFormatException'.
pkirch added 3 commits July 7, 2022 12:01
…om:agera-edc/DataSpaceConnector into feature/1535/254-automated-test-sample-041
@pkirch pkirch temporarily deployed to Azure-dev July 7, 2022 10:24 Inactive
@pkirch pkirch temporarily deployed to Azure-dev July 7, 2022 10:25 Inactive
…ple-041' into feature/1535/254-automated-test-sample-041
@pkirch pkirch temporarily deployed to Azure-dev July 7, 2022 11:26 Inactive
@pkirch pkirch temporarily deployed to Azure-dev July 7, 2022 11:29 Inactive
@pkirch pkirch marked this pull request as ready for review July 7, 2022 11:32
@pkirch pkirch requested a review from algattik as a code owner July 7, 2022 11:32
@pkirch pkirch requested review from chrislomonico and cpeeyush July 8, 2022 08:17
@ouphi ouphi self-requested a review July 8, 2022 08:20
@pkirch pkirch temporarily deployed to Azure-dev July 8, 2022 12:27 Inactive
@pkirch pkirch temporarily deployed to Azure-dev July 8, 2022 12:27 Inactive
@pkirch pkirch merged commit e3aaf76 into feature/1535-automated-tests-sample-041 Jul 8, 2022
@pkirch pkirch deleted the feature/1535/254-automated-test-sample-041 branch July 8, 2022 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Used for a workflow
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Automated Tests for Sample 04.1
6 participants