Yousaf Nabi (pactflow.io)
https://user-images.githubusercontent.com/53900/180370118-f11c61f3-4ae0-496f-98fa-052fdfad409e.gifā¾
david nguyen
08/29/2022, 4:49 AMdavid nguyen
08/29/2022, 4:49 AMSiddharth Gupta
08/29/2022, 9:16 AMThai Le
08/29/2022, 6:42 PMAndrew Papia
08/30/2022, 2:25 PMShan
08/30/2022, 2:54 PMpactbroker.providerBranch
or tag I still need some clarification. When I do this in Jenkins, what is the value I should assign to that variable? GIT_BRANCH
or GIT_MAIN_BRANCH.
From my understanding, the reason we are setting a value here because only that provider branch is eligible for pending pact feature. Is that right?Sravan
08/30/2022, 4:15 PMPublishing 'ppe-service-bus-issue-compilation-ppe-service-ent-issue-compilation.json' ... FAILED! 409 Conflict - {"error":"Cannot change the content of the pact for ppe-service-bus-issue-compilation version 1.0.0 and provider ppe-service-ent-issue-compilation, as race conditions will cause unreliable results for can-i-deploy. Each pact must be published with a unique consumer version number. For more information see <https://docs.pact.io/go/versioning>"}
I'm not sure why it is failing and the same json file is getting verified when the run the provider from my local machine pointing to the json file. Any idea?Sravan
08/30/2022, 5:04 PM{
"pacticipantName": "Foo",
"pacticipantVersionNumber": "dc5eb529230038a4673b8c971395bd2922d8b240",
"branch": "main",
"tags": [
"main"
],
"buildUrl": "<https://ci/builds/1234>",
"contracts": [
{
"consumerName": "Foo",
"providerName": "Bar",
"specification": "pact",
"contentType": "application/json",
"content": "<base64 encoded JSON pact>"
}
]
}
Response:
{
"notices": [
{
"type": "error",
"text": "Cannot change the content of the pact for ppe-service-ent-issue-compilation version 1.0.0 and provider ppe-service-ent-issue-compilation, as race conditions will cause unreliable results for can-i-deploy. Each pact must be published with a unique consumer version number. For more information see <https://docs.pact.io/go/versioning>"
},
{
"type": "info",
"text": ""
}
],
"errors": {
"contracts": [
"Cannot change the content of the pact for ppe-service-ent-issue-compilation version 1.0.0 and provider ppe-service-ent-issue-compilation, as race conditions will cause unreliable results for can-i-deploy. Each pact must be published with a unique consumer version number. For more information see <https://docs.pact.io/go/versioning>"
]
}
}
I dont see any difference in the content that is causing this issueSemih Ural
09/01/2022, 10:38 AMMatt (pactflow.io / pact-js / pact-go)
PACT_FLOW_50
to secure your spot.
Sign up š <https://pactflow.us4.list-manage.com/track/click?u=d975bc32fd84ad3580ed4777e&id=1581d47252&e=f3a6913421
|here>.
The course will teach you:
⢠the good practices of unit, integration, and e2e testing and learn how to implement them in front-end and back-end
⢠How to test the architecture from different perspectives like dependencies and abstraction layers
⢠The importance of setting up different quality gates in the project securing its long-term success
⢠How to establish an automation mindset to free your time to do the āreal workā and monitor quality metrics provided by different tools
The course is delivered via 1-2 hours of dense video content, with assignments after each module to put into practice what you learned.
In includes lifetime access to on-demand video lessons, as well as ten weeks of support on Slack and via Zoom.
If you have any questions, Iām sure @Bartosz Pietrucha will be happy to to field them.Maksym Liannoi
09/02/2022, 9:47 AMtask-api-consumer-task-api-provider.json
) for checking responses to all features from the provider side or better split generating pact files depending on provider features (e.g. task-api-consumer-task-api-provider-crud.json
and task-api-consumer-task-api-provider-filter.json
) and after that writing two verification test methods on the provider side for each coming pact files?
2. Where should I save the pact file path? Is reading from a configuration file (such as launchSettings.json) for a test project better than C# constant?
3. If a consumer has many providers, which algorithm is better to use if I need to publish one pact file to a specific provider? Depend on the pact file prefix, or save the pact file in a particular folder during generation on the consumer side on passing tests?
Thanks,
MaksymWei Huang
09/03/2022, 2:22 AMMaksym Liannoi
09/05/2022, 10:14 PMGET
and POST
methods, we should name the provider states as Task with existing ID is available
and Task with the correct body is created
. But, how should we call the provider state of checking unauthorized scenarios or bad requests (with invalid request body)? And which name of the provider state is better in the point of view of Pact best practices, the first one or post-task-success
and get-task-success
?Sneha Singh
09/06/2022, 7:46 PMŠŠ»ŠµŠŗŃŠ°Š½Š“Ń ŠŠ²ŃŠ°Š¼ŃŠøŠŗ
09/07/2022, 1:19 PMSneha Singh
09/07/2022, 1:28 PM'use strict'
process.env.REACT_APP_ENGINE_SERVICE_URL = '<http://localhost:8992>'
import { expect } from 'chai'
import path from 'path'
import { Pact } from '@pact-foundation/pact'
import { fetchACEFields } from '../api/index'
describe('fetch ACE fields', () => {
const port = 8992
const objectType = 'dummy'
const provider = new Pact({
port: port,
log: path.resolve(process.cwd(), 'logs', 'mockserver-integration.log'),
dir: path.resolve(process.cwd(), 'pacts'),
spec: 2,
consumer: 'webapp',
provider: 'engine-service',
pactfileWriteMode: 'merge',
})
const expectedBody = { status: true, data: [{ fullName: 'dummy' }] }
before(() => provider.setup())
after(() => provider.finalize())
afterEach(() => provider.verify())
describe('request to fetch fields', () => {
before(done => {
const interaction = {
state: 'fetch ace fields',
uponReceiving: 'a request to get all ace fields',
withRequest: {
method: 'GET' as const,
path: `/ace-fields?object_type=${objectType}`,
headers: {
Accept: 'application/json',
},
},
willRespondWith: {
status: 200,
headers: {
'Content-Type': 'application/json',
},
body: expectedBody,
},
}
provider.addInteraction(interaction).then(() => {
done()
})
})
it('verify it returns the correct response', async () => {
const res = await fetchACEFields(objectType)
expect(res).equal(expectedBody)
})
})
})
Error:
ReferenceError: navigator is not defined
at Object.<anonymous> (/Users/snehasingh/Documents/webapp/node_modules/flags/node_modules/supports-color/browser.js:3:58)
at Module._compile (internal/modules/cjs/loader.js:1068:30)
at Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Object.require.extensions.<computed> [as .js] (/Users/snehasingh/Documents/webapp/node_modules/ts-node/src/index.ts:1445:43)
Alan Zhu
09/08/2022, 4:15 AM.object("updatedAt", updatedAt ->
updatedAt
.integerType("epochSeconds",1661307606)
Matt (pactflow.io / pact-js / pact-go)
Sneha Singh
09/08/2022, 7:36 AM'use strict'
process.env.REACT_APP_ENGINE_SERVICE_URL = '<http://localhost:8992>'
import path from 'path'
import { Pact } from '@pact-foundation/pact'
import { fetchACEFields } from '../api/index'
const port = 8992
const objectType = 'dummy'
const provider = new Pact({
port: port,
log: path.resolve(process.cwd(), 'logs', 'mockserver-integration.log'),
dir: path.resolve(process.cwd(), 'pacts'),
spec: 2,
consumer: 'webapp',
provider: 'engine-service',
pactfileWriteMode: 'merge',
})
describe('fetch ACE fields', () => {
const expectedBody = { status: true, data: [{ fullName: 'dummy' }] }
beforeAll(async () => {
await provider.setup();
});
describe('request to fetch ACE fields', () => {
beforeAll(async () => {
await provider.addInteraction({
state: 'fetch ace fields',
uponReceiving: 'a request to get all ace fields',
withRequest: {
method: 'GET',
path: `/ace-fields?object_type=${objectType}`,
headers: {
Accept: 'application/json',
},
},
willRespondWith: {
status: 200,
headers: {
'Content-Type': 'application/json',
},
body: expectedBody,
},
});
});
test('verify it returns the correct response', async () => {
const res = await fetchACEFields(objectType)
expect(res).toBe(expectedBody)
})
})
})
Yousaf Nabi (pactflow.io)
Daniel Flieger
09/13/2022, 6:57 AMThai Le
09/13/2022, 9:29 PMĆdouard Lopez
09/15/2022, 8:55 AMPaulo GonƧalves
07/20/2021, 2:44 PMPaulo GonƧalves
09/16/2022, 8:51 PMTien Vo
09/19/2022, 1:55 AMmatchers
in https://github.com/pact-foundation/pact-specification/tree/version-2 and https://github.com/pact-foundation/pact-specification/tree/version-3 is something else different, not related, right?
I can't find it here too https://docs.pact.io/getting_started/matchingAdam LukaÄka
09/20/2022, 12:44 PMcan-i-deploy
passes new contract is published to pact broker (this is in build pipeline)
⢠this publishes contract e.g. consumer 1.0 & provider 1.0
⦠when I deploy consumer 1.1
this will publish contract consumer 1.1 & provider 1.0
⦠when I deploy consumer 1.2
this will publish contract consumer 1.2 & provider 1.0
now my question is if I deploy provider 1.1
how do I publish new contract between consumer and provider?
I guess in this case if we follow the above example if provider 1.1
is deployed then contract between consumer 1.2 & provider 1.1
should be published? how do I publish this new contract new consumer builds? or am I missing something?Owen Oclee
09/20/2022, 1:59 PMMazin
09/22/2022, 1:34 PM