Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Enable notification integrationtest #376

Conversation

gciavarrini
Copy link
Contributor

@gciavarrini gciavarrini commented May 26, 2023

What this PR does / why we need it:
Enable notification service integration tests.
NotificationRecordTest has been refactored to match project code style/implementation.
In addition to that, it was necessary to fix the test to let it work with the integration tests in CI.

Future PRs will improve the NotificationRecordTest implementation.

Documentation PRs:

Fixes # FLPATH-348

Change type

  • New feature
  • Bug fix
  • Unit tests
  • Integration tests
  • CI
  • Documentation
  • Auto-generated SDK code

Impacted services

  • Workflow Service
  • Notification Service

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.

spec:
rules:
- http:
paths:
- pathType: Prefix
path: /
path: /workflow-service(/|$)(.*)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this change require also an update or a similar configuration on the UI?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I do not think that it's the good way, then your swaggers configs are out of control, each service should have his own ingress.

backend:
service:
name: workflow-service
port:
number: 8080
- pathType: Prefix
path: /notification-service(/|$)(.*)
Copy link
Collaborator

Choose a reason for hiding this comment

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

same for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

seems good to me, but requires verification and feedback from parodos-backstage maintainers.

@@ -36,9 +36,9 @@
*/

@Slf4j
public abstract class SdkUtils {
public abstract class WorkFlowServiceSdkUtils {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we go with: WorkFlowServiceUtils ?
sdk is already implied by the package name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. I also changed the NotificationServiceSdkUtils according to your suggestion.

hack/manifests/testing/parodos-patch.yaml Outdated Show resolved Hide resolved
throws ApiException, MissingRequiredPropertiesException, InterruptedException {
ApiClient apiClient = Configuration.getDefaultApiClient();
String serverIp = Optional.ofNullable(System.getenv("SERVER_IP")).orElse("localhost");
String serverPort = Optional.ofNullable(System.getenv("SERVER_PORT")).orElse("8080");
Copy link
Contributor

Choose a reason for hiding this comment

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

Default port 8081

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertTrue;

public class NotificationTestBuilder {
Copy link
Contributor

@nirarg nirarg May 29, 2023

Choose a reason for hiding this comment

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

There are duplicates between NotificationTestBuilder to WorkFlowTestBuilder
Consider to move those duplicates to common parent abstract class
(public class NotificationTestBuilder extends BaseTestBuilder)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem is that the duplicate code relies on objects that seems the same but that belong to different packages (for example com.redhat.parodos.sdkutils.ApiClient and com.redhat.parodos.sdk.invoker.ApiClient`). Such generated classes don't implement any common interface, so it's difficult to extract an abstract class.

Maybe in another PR we can try to write a wrapper for such sdk generated classes to reduce the code duplication. WDYT?

gciavarrini added a commit to gciavarrini/backstage-parodos that referenced this pull request Jun 5, 2023
To reflect changes made in `parodos` PR parodos-dev/parodos#376

When deploying `parodos` locally or in a `Kind` cluster using `kubectl kustomize hack/manifests/testing | kubectl apply -f -` the workflow service and the notification service paths have been changed.

Depends on PR parodos-dev/parodos#376

Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
@gciavarrini gciavarrini force-pushed the enable-notification-integrationtest branch from 39b4ede to c2cd035 Compare June 5, 2023 13:12
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
@gciavarrini gciavarrini force-pushed the enable-notification-integrationtest branch from c2cd035 to f3ab1e9 Compare June 6, 2023 10:39
@gciavarrini gciavarrini force-pushed the enable-notification-integrationtest branch from f3ab1e9 to 8e52d8f Compare June 6, 2023 11:53
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
@gciavarrini gciavarrini force-pushed the enable-notification-integrationtest branch from 8e52d8f to 4402522 Compare June 6, 2023 12:12
@gciavarrini gciavarrini requested a review from masayag June 6, 2023 12:19
@gciavarrini gciavarrini requested a review from eloycoto June 6, 2023 12:19
gciavarrini added a commit to gciavarrini/parodos-dev.github.io that referenced this pull request Jun 6, 2023
To reflect changes in PR parodos-dev/parodos#376

Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
@masayag
Copy link
Collaborator

masayag commented Jun 6, 2023

/lgtm

@masayag
Copy link
Collaborator

masayag commented Jun 6, 2023

There are going to be conflicts with #399
First one to merge, wins :-)

@openshift-ci openshift-ci bot added the lgtm label Jun 6, 2023
gciavarrini added a commit to gciavarrini/parodos-dev.github.io that referenced this pull request Jun 6, 2023
To reflect changes in PR parodos-dev/parodos#376

Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
gciavarrini added a commit to gciavarrini/parodos-dev.github.io that referenced this pull request Jun 6, 2023
To reflect changes in PR parodos-dev/parodos#376

Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
@openshift-ci
Copy link

openshift-ci bot commented Jun 6, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pkliczewski

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Jun 6, 2023
@openshift-merge-robot openshift-merge-robot merged commit f11110c into parodos-dev:main Jun 6, 2023
gciavarrini added a commit to gciavarrini/parodos-dev.github.io that referenced this pull request Jun 7, 2023
To reflect changes in PR parodos-dev/parodos#376

Signed-off-by: Gloria Ciavarrini <gciavarrini@redhat.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants