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

Fixes: 15835 : Added tests covering EventSubscription. #16298

Conversation

Siddhanttimeline
Copy link
Contributor

@Siddhanttimeline Siddhanttimeline commented May 16, 2024

Fixes : 15835

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

@Siddhanttimeline Siddhanttimeline requested a review from a team as a code owner May 16, 2024 08:59
Copy link

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Copy link

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@Siddhanttimeline Siddhanttimeline changed the title Fixes: 15835 : Added tests covering different scenarios for EventSubscription. Fixes: 15835 : Added tests covering EventSubscription. May 16, 2024
@TeddyCr TeddyCr added the safe to test Add this label to run secure Github workflows on PRs label May 16, 2024
Copy link

sonarcloud bot commented May 30, 2024

Quality Gate Passed Quality Gate passed for 'open-metadata-ingestion'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@@ -0,0 +1,181 @@
package org.openmetadata.service.resources.events;
Copy link
Contributor

Choose a reason for hiding this comment

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

this is completely same as the WebhookCallbackResource , I think if there is nothing that's changing we can utilise the same class

@@ -466,6 +475,12 @@ public void afterAllTests() throws Exception {
EventSubscriptionResourceTest alertResourceTest = new EventSubscriptionResourceTest();
alertResourceTest.validateWebhookEvents();
alertResourceTest.validateWebhookEntityEvents(entityType);

Copy link
Contributor

Choose a reason for hiding this comment

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

@Siddhanttimeline here I would suggest to enable the subscription tests randomly , and choose one of the publisher type to be setup only (random as well) , it does not make sense to run all three , it would increase the CI time significantly

return "slackTest";
}

public String getEntityUrl(String prefix, String fqn, String additionalParams) {
Copy link
Contributor

Choose a reason for hiding this comment

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

what we should be doing here is , in the slack/msteams see if there is a way to add extra attributes, and set link attr , we don't need to replicate the entity url building logic here , use existing one , and check if the link received in those extra attr is same

@@ -3107,6 +3122,21 @@ protected EntityHistory getVersionList(UUID id, Map<String, String> authHeaders)
return TestUtils.get(target, EntityHistory.class, authHeaders);
}

protected ResultList<ChangeEvent> getChangeEvents(
Copy link
Contributor

Choose a reason for hiding this comment

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

why are we copying the same logic for getChangeEvents, utilise the below function no?
Take timestamp as arg, and only set it as query param when it is not null

@mohityadav766 mohityadav766 merged commit 541df25 into open-metadata:main May 30, 2024
14 checks passed
@Siddhanttimeline Siddhanttimeline deleted the improvements-testCase-notifications-observability branch June 5, 2024 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend safe to test Add this label to run secure Github workflows on PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants