15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/pact_broker/db/seed_example_data.rb', line 15
def call(consumer_name: CONSUMER_NAME, provider_name: PROVIDER_NAME)
return unless database_empty?
PactBroker::Test::TestDataBuilder.new
.create_environment("test", display_name: "Test", production: false)
.create_environment("production", display_name: "Production", production: true)
.create_consumer(consumer_name, created_at: days_ago(16))
.create_provider(provider_name, created_at: days_ago(16))
.create_consumer_version("e15da45d3943bf10793a6d04cfb9f5dabe430fe2", branch: "main", created_at: days_ago(16))
.create_consumer_version_tag("prod", created_at: days_ago(16))
.create_consumer_version_tag("main", created_at: days_ago(16))
.create_deployed_version_for_consumer_version(environment_name: "production", currently_deployed: false, created_at: days_ago(16))
.create_pact(json_content: pact_1, created_at: days_ago(16))
.create_verification(provider_version: "1315e0b1924cb6f42751f977789be3559373033a", branch: "main", execution_date: days_ago(15))
.create_deployed_version_for_provider_version(environment_name: "production", currently_deployed: true, created_at: days_ago(15))
.create_deployed_version_for_consumer_version(environment_name: "production", currently_deployed: true, created_at: days_ago(14))
.create_verification(provider_version: "480e5aeb30467856ca995d0024d2c1800b0719e5", branch: "main", success: false, number: 2, execution_date: days_ago(14))
.create_provider_version_tag("main", created_at: days_ago(14))
.create_consumer_version("725c6ccb7cf7efc51b4394f9828585eea9c379d9", branch: "feat/new-thing", created_at: days_ago(7))
.create_consumer_version_tag("feat-new-thing", created_at: days_ago(7))
.create_pact(json_content: pact_2, created_at: days_ago(7))
.create_consumer_version("6c992f831da299364cf31be6008ee4752189f6d4", branch: "feat/new-thing", created_at: days_ago(6))
.create_consumer_version_tag("feat-new-thing", created_at: days_ago(6))
.create_pact(json_content: pact_2, created_at: days_ago(7))
.create_consumer_version("7bd4d9173522826dc3e8704fd62dde0424f4c827", branch: "main", created_at: days_ago(1))
.create_consumer_version_tag("main", created_at: days_ago(1))
.create_pact(json_content: pact_3, created_at: days_ago(1))
.create_verification(provider_version: "4fdf20082263d4c5038355a3b734be1c0054d1e1", branch: "main", execution_date: days_ago(1))
.create_deployed_version_for_provider_version(environment_name: "test", created_at: days_ago(1))
.create_provider_version_tag("main", created_at: days_ago(1))
.create_consumer_version("5556b8149bf8bac76bc30f50a8a2dd4c22c85f30", branch: "main", created_at: days_ago(0.5))
.create_consumer_version_tag("main", created_at: days_ago(0.5))
.create_deployed_version_for_consumer_version(environment_name: "test", created_at: days_ago(0.5))
.republish_same_pact(created_at: days_ago(0.5))
end
|