Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

test: Refactor IntegrationResourceTest v2 #789

Merged
merged 1 commit into from
Jul 19, 2023

Conversation

mkralik3
Copy link
Contributor

@mkralik3 mkralik3 commented Jul 18, 2023

  • Refactored IntegrationResourceTest (v2 only) to use Assertj for better error messages
  • Resources which are used only in V1 test ( which is deprecated) were moved into separate folder ( can be deleted in the future with old resources tests ) and removed unused resources
  • Some existing tests were extended and added kamelet metadata test

@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Merging #789 (56decd4) into main (acffcff) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##               main     #789   +/-   ##
=========================================
  Coverage     79.24%   79.24%           
  Complexity      160      160           
=========================================
  Files            56       56           
  Lines          3040     3040           
  Branches        529      529           
=========================================
  Hits           2409     2409           
  Misses          415      415           
  Partials        216      216           

@mkralik3 mkralik3 force-pushed the integrationsResourceTests branch from 041bb73 to 899e2eb Compare July 18, 2023 12:24
@@ -418,14 +464,14 @@ void roundTrip(String file) throws IOException {
var sourceCode = res2.extract().body().asString();

//This should be the same as the original source code
Copy link
Contributor Author

@mkralik3 mkralik3 Jul 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes, tests on my local machine failed here because the original yaml and generated yaml have different properties order spec.source.properties

    properties:
      apiKey: your own
      keywords: Apache Camel
      apiKeySecret: your own
      accessToken: your own
      accessTokenSecret: your own
properties:
      keywords: Apache Camel
      apiKey: your own
      apiKeySecret: your own
      accessToken: your own
      accessTokenSecret: your own

Comparing YAMLs as objects should resolve that problem and will be resistant to the different ordering of elements.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a good comparison tool for yaml objects? I couldn't find any, that's why I compare as strings. But compare as strings is a nightmare every time some minor change occurs (like change " by ')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know about any but I can try to find out some.

@mkralik3 mkralik3 marked this pull request as ready for review July 18, 2023 13:48
@mkralik3 mkralik3 requested a review from a team July 18, 2023 13:48
@mkralik3 mkralik3 force-pushed the integrationsResourceTests branch from 899e2eb to 56decd4 Compare July 18, 2023 14:06
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@mkralik3 mkralik3 linked an issue Jul 18, 2023 that may be closed by this pull request
@Delawen Delawen merged commit 5be6866 into kaoto-archive:main Jul 19, 2023
@mkralik3 mkralik3 deleted the integrationsResourceTests branch August 3, 2023 10:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide native test corresponding to IntegrationsResourceTest
2 participants