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

feat: seed connector test data into the portal #172

Merged
2 changes: 1 addition & 1 deletion charts/umbrella/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sources:
- https://github.com/eclipse-tractusx/tractus-x-umbrella

type: application
version: 2.0.7
version: 2.0.8

# when adding or updating versions of dependencies, also update list under README.md#Install
dependencies:
Expand Down
259 changes: 259 additions & 0 deletions charts/umbrella/templates/configmap-backend-seeding-testdata.yaml
CDiezRodriguez marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
{{- /*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/}}

{{- if .Values.portal.backend.portalmigrations.seeding.useDefault -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: "portal-default-testdata"
CDiezRodriguez marked this conversation as resolved.
Show resolved Hide resolved
namespace: {{ .Release.Namespace }}
data:
addresses.defaulttest.json: |-
CDiezRodriguez marked this conversation as resolved.
Show resolved Hide resolved
[
{
"id": "b4db3945-19a7-4a50-97d6-e66e8dfd04fe",
"date_created": "2022-03-24 18:01:33.306000 +00:00",
"date_last_changed": "2022-03-24 18:01:33.306000 +00:00",
"city": "Munich",
"region": null,
"streetadditional": null,
"streetname": "Street",
"streetnumber": "1",
"zipcode": "00001",
"country_alpha2code": "DE"
},
{
"id": "aa49c0ec-4e65-4115-a01c-7adfc36d220e",
"date_created": "2022-03-24 18:01:33.391000 +00:00",
"date_last_changed": "2022-03-24 18:01:33.391000 +00:00",
"city": "Berlin",
"region": null,
"streetadditional": null,
"streetname": "Street",
"streetnumber": "4",
"zipcode": "00001",
"country_alpha2code": "DE"
},
{
"id": "86da3e1c-a634-41a6-ad44-9880746123e4",
"date_created": "2022-03-24 18:01:33.435000 +00:00",
"date_last_changed": "2022-03-24 18:01:33.435000 +00:00",
"city": "Cologne",
"region": null,
"streetadditional": null,
"streetname": "Street",
"streetnumber": "6",
"zipcode": "00001",
"country_alpha2code": "DE"
},
{
"id": "0f562ea7-4cc1-47a9-bfee-b41b0ac67ebb",
"date_created": "2022-03-24 18:01:33.443000 +00:00",
"date_last_changed": "2022-03-24 18:01:33.443000 +00:00",
"city": "Munich",
"region": null,
"streetadditional": null,
"streetname": "Street",
"streetnumber": "17",
"zipcode": "00001",
"country_alpha2code": "DE"
},
{
"id": "081c8bfd-c6d1-4119-a5f8-a69726dfc11e",
"date_created": "2022-03-24 18:01:33.428000 +00:00",
"date_last_changed": "2022-03-24 18:01:33.428000 +00:00",
"city": "Rome",
"region": null,
"streetadditional": null,
"streetname": "Street",
"streetnumber": "9",
"zipcode": "00001",
"country_alpha2code": "IT"
},
{
"id": "081c8bfd-c6d1-4119-a5f8-a69726dfc11f",
"date_created": "2022-03-24 18:01:33.428000 +00:00",
"date_last_changed": "2022-03-24 18:01:33.428000 +00:00",
"city": "Paris",
"region": null,
"streetadditional": null,
"streetname": "Street",
"streetnumber": "9",
"zipcode": "00001",
"country_alpha2code": "FR"
},
{
"id": "f267f020-2caf-4d64-9aa1-20a6c123fe15",
"date_created": "2022-03-24 18:01:33.428000 +00:00",
"date_last_changed": "2022-03-24 18:01:33.428000 +00:00",
"city": "Vienna",
"region": null,
"streetadditional": null,
"streetname": "Street",
"streetnumber": "9",
"zipcode": "00001",
"country_alpha2code": "AT"
}
]
companies.defaulttest.json: |-
[
{
"id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f88",
"date_created": "2022-03-24 18:01:33.306000 +00:00",
"business_partner_number": "BPNL00000003AYRE",
"name": "OEM_A",
"shortname": "OEM_A",
"company_status_id": 2,
"address_id": "b4db3945-19a7-4a50-97d6-e66e8dfd04fe",
"self_description_document_id": "f90962ee-a358-4381-8947-c56268ff32c7"
},
{
"id": "220330ac-170d-4e22-8d72-9467ed042149",
"date_created": "2022-03-24 18:01:33.393000 +00:00",
"business_partner_number": "BPNL00000003AVTH",
"name": "OEM_B",
"shortname": "OEM_B",
"company_status_id": 1,
"address_id": "aa49c0ec-4e65-4115-a01c-7adfc36d220e",
"self_description_document_id": "f90962ee-a358-4381-8947-c56268ff32c7"
},
{
"id": "bdac6865-2a8d-4bfd-9373-9dfce8190895",
"date_created": "2022-03-24 18:01:33.430000 +00:00",
"business_partner_number": "BPNL00000003AZQP",
"name": "OEM_C",
"shortname": "OEM_C",
"company_status_id": 1,
"address_id": "0f562ea7-4cc1-47a9-bfee-b41b0ac67ebb",
"self_description_document_id": "f90962ee-a358-4381-8947-c56268ff32c7"
},
{
"id": "41fd2ab8-71cd-4546-9bef-a388d91b2542",
"date_created": "2022-03-24 18:01:33.438000 +00:00",
"business_partner_number": "BPNL00000003B0Q0",
"name": "N_TIER_A",
"shortname": "N_TIER_A",
"company_status_id": 1,
"address_id": "86da3e1c-a634-41a6-ad44-9880746123e4",
"self_description_document_id": "f90962ee-a358-4381-8947-c56268ff32c7"
},
{
"id": "3390c2d7-75c1-4169-aa27-6ce00e1f3cdd",
"date_created": "2022-10-01 00:00:00.000000 +00:00",
"business_partner_number": "BPNL0000000012RP",
"name": "Service Provider",
"shortname": "SP",
"company_status_id": 2,
"address_id": "081c8bfd-c6d1-4119-a5f8-a69726dfc11e",
"self_description_document_id": "f90962ee-a358-4381-8947-c56268ff32c7"
},
{
"id": "3390c2d7-75c1-4169-aa27-6ce00e1f3cde",
"date_created": "2022-10-01 00:00:00.000000 +00:00",
"business_partner_number": "BPNL00000003CSLL",
"name": "App Provider",
"shortname": "SP",
"company_status_id": 2,
"address_id": "081c8bfd-c6d1-4119-a5f8-a69726dfc11f",
"self_description_document_id": "f90962ee-a358-4381-8947-c56268ff32c7"
},
{
"id": "2647e4f9-0d11-479f-b927-643cd9321c00",
"date_created": "2022-10-01 00:00:00.000000 +00:00",
"business_partner_number": "BPNL000000001OSP",
"name": "Onboarding-Provider",
"shortname": "Onboarding-Provider",
"company_status_id": 2,
"address_id": "f267f020-2caf-4d64-9aa1-20a6c123fe15",
"self_description_document_id": "f90962ee-a358-4381-8947-c56268ff32c7"
}
]
connectors.defaulttest.json: |-
[
{
"id": "7e86a0b8-6903-496b-96d1-0ef508206833",
"name": "OEM A Connector",
"connector_url": "http://dataprovider-controlplane.tx.test",
"type_id": 1,
"status_id": 2,
"provider_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f88",
"host_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f88",
"location_id": "DE",
"self_description_document_id": null
},
{
"id": "7e86a0b8-6903-496b-96d1-0ef508206834",
"name": "N_TIER_A Connector",
"connector_url": "http://umbrella-dataprovider-edc-controlplane:8084",
"type_id": 1,
"status_id": 2,
"provider_id": "41fd2ab8-71cd-4546-9bef-a388d91b2542",
"host_id": "41fd2ab8-71cd-4546-9bef-a388d91b2542",
"location_id": "DE",
"self_description_document_id": null
},
{
"id": "7e86a0b8-6903-496b-96d1-0ef508206835",
"name": "Test Connector 1",
"connector_url": "http://dataprovider-controlplane.tx.test",
"type_id": 1,
"status_id": 2,
"provider_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"host_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"location_id": "DE",
"self_description_document_id": null
},
{
"id": "7e86a0b8-6903-496b-96d1-0ef508206836",
"name": "Test Connector 2",
"connector_url": "http://dataprovider-controlplane.tx.test",
"type_id": 1,
"status_id": 2,
"provider_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"host_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"location_id": "DE",
"self_description_document_id": null
},
{
"id": "7e86a0b8-6903-496b-96d1-0ef508206837",
"name": "Test Connector 3",
"connector_url": "http://dataprovider-controlplane.tx.test",
"type_id": 1,
"status_id": 1,
"provider_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"host_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"location_id": "DE",
"self_description_document_id": null
}
]
documents.defaulttest.json: |-
[
{
"id": "f90962ee-a358-4381-8947-c56268ff32c7",
"date_created": "2023-09-28T09:02:11.131663+00:00",
"document_hash": "riK1M7T4OZsSwX8Mx2RdxEXls9OFz+lcKgq0X+lhYg71F+y6bpUNcMeaYf1dC3xqFdA9W25KEjJlgOQ3Vo6sxg==",
"document_content": "ewogICJzZWxmRGVzY3JpcHRpb25DcmVkZW50aWFsIjogewogICAgIlNlcnZpY2VPZmZlcmluZyI6IHsKICAgICAgIkBjb250ZXh0IjogWwogICAgICAgICJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSIsCiAgICAgICAgImh0dHBzOi8vZjFjODI3ODUtNTU5OC00MWM3LWEwODMtMDFhOGUxYTgwZTE5Lm1vY2sucHN0bW4uaW8vY3R4c2QiCiAgICAgIF0sCiAgICAgICJ0eXBlIjogWwogICAgICAgICJWZXJpZmlhYmxlQ3JlZGVudGlhbCIKICAgICAgXSwKICAgICAgImlkIjogImh0dHBzOi8vY2FybGEuZGloLWNsb3VkLmNvbS90ZXN0L2NvbXBsaWFuY2Vfc2VydmljZS9wYXJ0aWNpcGFudC9CUE5MMDAwMDAwMDNBWlFQX3BhcnRpY2lwYW50Lmpzb24iLAogICAgICAiY3JlZGVudGlhbFN1YmplY3QiOiB7CiAgICAgICAgImJwbiI6ICJCUE5MSU5JVElBTERBVEFMT0FEIiwKICAgICAgICAicmVnaXN0cmF0aW9uTnVtYmVyIjogWwogICAgICAgICAgewogICAgICAgICAgICAidHlwZSI6ICJ2YXRJRCIsCiAgICAgICAgICAgICJ2YWx1ZSI6ICJERTI5MTYzNjAyOSIKICAgICAgICAgIH0KICAgICAgICBdLAogICAgICAgICJoZWFkcXVhcnRlckFkZHJlc3MiOiB7CiAgICAgICAgICAiY291bnRyeUNvZGUiOiAiREUiCiAgICAgICAgfSwKICAgICAgICAidHlwZSI6ICJMZWdhbFBhcnRpY2lwYW50IiwKICAgICAgICAibGVnYWxBZGRyZXNzIjogewogICAgICAgICAgImNvdW50cnlDb2RlIjogIkRFIgogICAgICAgIH0sCiAgICAgICAgImlkIjogIkJQTkxJTklUSUFMREFUQUxPQUQiCiAgICAgIH0sCiAgICAgICJpc3N1ZXIiOiAiQlBOTDAwMDAwMDAzQ1JISyIsCiAgICAgICJpc3N1YW5jZURhdGUiOiAiMjA5OS0wMC0wMFQwMDowMDowMDAiLAogICAgICAicHJvb2YiOiB7CiAgICAgICAgInR5cGUiOiAiSnNvbldlYlNpZ25hdHVyZTIwMjAiLAogICAgICAgICJjcmVhdGVkIjogIjIwOTktMDAtMDBUMDA6MDA6MDAwIiwKICAgICAgICAicHJvb2ZQdXJwb3NlIjogImFzc2VydGlvbk1ldGhvZCIsCiAgICAgICAgImp3cyI6ICJleUpoYkdjaU9pSlFVekkxTmlJc0ltSTJOQ0k2Wm1Gc2MyVXNJbU55YVhRaU9sc2lZalkwSWwxOS4uSUVKbGo3U2FEQWhqRGp2X2p0N1NfSUt3RVY4X1Q0cVM1ZFhCQ09TNF9xemZVczNNcFZ4WTZxNGxGSTUtOU9mald0blNhQkZDUzBkY0xCWFgtck9mM3dDVUgya245NGU4RldXemZndmxHMHdhM3RzbHRpaXN6UVBDNmJHZjY4MEhTR04yX0VBZ3NpWWdJMTRqVjFxTUhqd1ZFb1NpejJRRk1CNFFhNkF5WHRFSXotbF9reHBhVW9CLXBLYjEyOGJwYUFmN255VV9Eei1kWWFpOXViUTRReDRocHJwQS1Rb3dBR1dHM0JReUR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W0xSUhZSTNkbU16dm1jMUEyNjA0ZW5FanRhdW1jbnlEXzBGcm1nakxua1JLZm9MSHVJS1lsWDd4a3dEU052SGQ2XzcybEc3MjMtU0tmQ3FGZG9KUVBiT2s5UzFuOE5Eczc2dzVzSFV1VGJUQzZGT1JQNFk4U3dqZEF6RDUtb3V1RUhOeVVjMHA1aG9jd1NMTTFyaXFkeGZjeEJwSTVDbjVsa2hMVVlqUzlUR3NVcGJpc1NmNUx4TGk3S2JIVTNwRGZnSDBCZkU3MlMxb3dDSVRSRnR5WnNQbkR0NE9ZNjRxMzI4RGNPd0VEaXJzZ3NNMHBoUkp4dU9KQl9hdHdoaEhPR3JUOXpvZ1NOOFFxWVR6TVJBNGlyY1AzWjY2NTVlQXNmcXhRM21HRWptZTV2eFpHMWFtaFFQNjV0a1NqTVZNbFNnbTFvaWJDUmxXd09ySDZwWVpCa0hJMU1XZVc5Zm5sbTdwVWlpNUNoT3phaWJQZEZobU9uTUE5UFNKMEJRVk5qUVpRblVQRjNacmltVnNQNWhUN0g5VlVNTVhDN2VnQVR2OGVGZ2lNM19YQksySUNZamJRMjN2dXRCWUJmRFRfSXM0NWRoamlnZHQxX2I4dkV6TjNnWXJuTzV1SnhGZlV2SG52dEkxbjVFeldJUHBkZnNtWndXZlp2NzN0U1lRYzAwa3VhNXIzNU9UZG9YZFoxSjNPMmsiLAogICAgICAidmVyaWZpY2F0aW9uTWV0aG9kIjogImRpZDp3ZWI6Z3gtY29tcGxpYW5jZS50ZXN0LmRpaC1jbG91ZC5jb20iCiAgICB9CiAgfQp9",
"document_name": "SelfDescription_LegalPerson_Test.json",
"document_type_id": 8,
"document_status_id": 2,
"company_user_id": "ac1cf001-7fbc-1f2f-817f-bce058020006",
"media_type_id": 7
}
]
{{- end }}
9 changes: 9 additions & 0 deletions charts/umbrella/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,15 @@ portal:
senderEmail: "[email protected]"
password: ""
portalmigrations:
seeding:
useDefault: true
testDataEnvironments: ""
CDiezRodriguez marked this conversation as resolved.
Show resolved Hide resolved
# -- Option to seed test data provided in a configMap
testData:
# -- ConfigMap containing json files for the tables to seed, e.g. companies.test.json, addresses.test.json, etc.
configMap: "portal-default-testdata"
# -- Filename identifying the test data files e.g. for companies.test.json the value would be "test"
filename: "defaulttest"
CDiezRodriguez marked this conversation as resolved.
Show resolved Hide resolved
logging:
default: "Debug"
provisioning:
Expand Down