[FOLIO-1394] Spike - research which mock server would be the best to integrate with Pact and BigTest Created: 02/Aug/18  Updated: 09/Jun/23  Resolved: 31/Aug/18

Status: Closed
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None

Type: Story Priority: P3
Reporter: Anton Emelianov (Inactive) Assignee: Khalilah Gambrell
Resolution: Done Votes: 0
Labels: Pact, epam-folijet, no-epic-needed, uitestingteam
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Issue links:
Relates
relates to MODINVSTOR-259 Consume mod-circulation contract Open
relates to FOLIO-1397 Spike: UI Testing Information Gathering Closed
relates to FOLIO-1443 Spike: Pact testing with OKAPI Closed
relates to FOLIO-1451 Create "How to create Pact enabled un... Closed
relates to UIMPROF-11 Explore Mirage and Pact for UI testing Closed
Sprint: EPAM Sprint 3
Story Points: 8
Development Team: Folijet

 Description   

Currently, BigTest employs Mirage for its client-side mock server. Mirage doesn't support Pact integration out of the box. We need BigTest UI testing framework to support consumer-driven contract tests. The additional complexity is added by the fact that UI makes REST API request via Okapi ( not directly to an end-point published by producer module)

The goal of this story is to research what would be the best option:
1) Modify Mirage to support Pact
2) Figure out if a different mock server that supports Pact out of the box can be integrated with Pact.

Acceptance criteria:
1) Working demo of BigTest test that is using test-doubles that are captured into Pact files and stored on the Pact server
2) Test case for corresponding producer module that uses the same Pact file as mock.
3) Break a contract on producer side --> Modify Pact file --> prove that test failed on the BigTest side.



 Comments   
Comment by Oleksii Popov [ 29/Aug/18 ]

Pact serves well with its concept of contract testing.
Interaction explained and tested for both FE and BE side.
As a result of consumer (FE) test a special pact contract file is created (.json). Such files describe an interaction between consumer and provider (it can be FE+BE or two interacting BE modules).

Pact consumer (JavaScript) for demo session implemented here: https://github.com/oleksii-popov/pact-simple-consumer (includes authn/login and pact contract generation)
Pact provider test (Java) for serverside implemented here: https://github.com/Igor-Gorchakov/simplepact (OKAPI authn/login test, based on pact contract)

Will be shown on next UI testing meeting.

FYi Anton Emelianov Khalilah Gambrell Ann-Marie Breaux

Comment by Khalilah Gambrell [ 30/Aug/18 ]

Hey Anton Emelianov, we need you to confirm that the work for this user story is done. What is the best way for you to confirm?

Comment by Anton Emelianov (Inactive) [ 30/Aug/18 ]

Khalilah Gambrell, Code review should be done by Matt Reno. The actual demo is scheduled on Tuesday 9/2

Comment by Matt Reno [ 30/Aug/18 ]

I've looked at the Pact PoC repos and they demonstrate basic Pact consumer/producer generation/verification using existing Pact related generation/verification libraries.

I don't know if all the acceptance criteria are met as I am not familiar with BigTest. I don't see anything in the consumer code to suggest BigTest is being used as the test harness (it appears to be chai).

Otherwise, I think a demo of this could evoke several questions about how we can integrate it in the actual CI/CD pipeline, which is a good thing.

Comment by Khalilah Gambrell [ 31/Aug/18 ]

Oleksii Popov and Tetyana Afanasyeva, I am marking this as done. Based on feedback from the demo, we may add additional user stories to the backlog.

Generated at Thu Feb 08 23:13:01 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.