Skip to content
Snippets Groups Projects
Commit 42c39ab8 authored by Riabokon Stanislav(EPAM)[GCP]'s avatar Riabokon Stanislav(EPAM)[GCP]
Browse files

Merge branch 'rename-domain-env-variable' into 'master'

Renamed domain env variable (GONRG-6912)

See merge request !535
parents 6ad44b4b b4bdf1a7
No related branches found
No related tags found
1 merge request!535Renamed domain env variable (GONRG-6912)
Pipeline #186420 failed
......@@ -240,7 +240,7 @@ You will need to have the following environment variables defined.
| `ELASTIC_HOST` | ex `elastic.domain.com` | Host Elasticsearch | yes | output of infrastructure deployment |
| `ELASTIC_PORT` | ex `9243` | Port Elasticsearch | yes | output of infrastructure deployment |
| `INDEXER_HOST` | ex `https://os-indexer-dot-opendes.appspot.com/api/indexer/v2/` | Indexer API endpoint | no | output of infrastructure deployment |
| `ENTITLEMENTS_DOMAIN` | ex `opendes-gcp.projects.com` | OSDU R2 to run tests under | no | - |
| `GROUP_ID` | ex `opendes-gcp.projects.com` | OSDU R2 to run tests under | no | - |
| `OTHER_RELEVANT_DATA_COUNTRIES` | ex `US` | valid legal tag with a other relevant data countries | no | - |
| `LEGAL_TAG` | ex `opendes-demo-legaltag` | valid legal tag with a other relevant data countries from `DEFAULT_OTHER_RELEVANT_DATA_COUNTRIES` | no | - |
| `DEFAULT_DATA_PARTITION_ID_TENANT1` | ex `opendes` | HTTP Header 'Data-Partition-ID' | no | - |
......@@ -254,9 +254,9 @@ You will need to have the following environment variables defined.
**Entitlements configuration for integration accounts**
| INTEGRATION_TESTER | NO_DATA_ACCESS_TESTER |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|
| users<br/>users.datalake.ops<br/>service.storage.creator<br/>service.entitlements.user<br/>service.search.user<br/>service.search.admin<br/>data.test1<br/>data.integration.test<br/>users@{tenant1}@{domain}.com | |
| INTEGRATION_TESTER | NO_DATA_ACCESS_TESTER |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|
| users<br/>users.datalake.ops<br/>service.storage.creator<br/>service.entitlements.user<br/>service.search.user<br/>service.search.admin<br/>data.test1<br/>data.integration.test<br/>users@{tenant1}@{groupId}.com | |
Execute following command to build code and run all the integration tests:
......
......@@ -176,7 +176,7 @@ You will need to have the following environment variables defined.
| `ELASTIC_PORT` | ex `9243` | Port Elasticsearch | yes | output of infrastructure deployment |
| `GCLOUD_PROJECT` | ex `opendes` | Google Cloud Project Id | no | output of infrastructure deployment |
| `INDEXER_HOST` | ex `https://os-indexer-dot-opendes.appspot.com/api/indexer/v2/` | Indexer API endpoint | no | output of infrastructure deployment |
| `ENTITLEMENTS_DOMAIN` | ex `opendes-gc.projects.com` | OSDU R2 to run tests under | no | - |
| `GROUP_ID` | ex `opendes-gc.projects.com` | OSDU R2 to run tests under | no | - |
| `OTHER_RELEVANT_DATA_COUNTRIES` | ex `US` | valid legal tag with a other relevant data countries | no | - |
| `LEGAL_TAG` | ex `opendes-demo-legaltag` | valid legal tag with a other relevant data countries from `DEFAULT_OTHER_RELEVANT_DATA_COUNTRIES` | no | - |
| `DEFAULT_DATA_PARTITION_ID_TENANT1` | ex `opendes` | HTTP Header 'Data-Partition-ID' | no | - |
......@@ -188,9 +188,9 @@ You will need to have the following environment variables defined.
**Entitlements configuration for integration accounts**
| INTEGRATION_TESTER | NO_DATA_ACCESS_TESTER |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|
| users<br/>users.datalake.ops<br/>service.storage.creator<br/>service.entitlements.user<br/>service.search.user<br/>service.search.admin<br/>data.test1<br/>data.integration.test<br/>users@{tenant1}@{domain}.com |
| INTEGRATION_TESTER | NO_DATA_ACCESS_TESTER |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|
| users<br/>users.datalake.ops<br/>service.storage.creator<br/>service.entitlements.user<br/>service.search.user<br/>service.search.admin<br/>data.test1<br/>data.integration.test<br/>users@{tenant1}@{groupId}.com |
Execute following command to build code and run all the integration tests:
......
......@@ -27,6 +27,7 @@ import lombok.extern.java.Log;
import org.opengroup.osdu.common.SchemaServiceRecordSteps;
import org.opengroup.osdu.util.AnthosHTTPClient;
import org.opengroup.osdu.util.ElasticUtils;
import org.opengroup.osdu.util.conf.AnthosConfig;
@Log
public class Steps extends SchemaServiceRecordSteps {
......@@ -37,6 +38,7 @@ public class Steps extends SchemaServiceRecordSteps {
@Before
public void before(Scenario scenario) {
AnthosConfig.updateEntitlementsDomainVariable();
this.scenario = scenario;
this.httpClient = new AnthosHTTPClient();
}
......@@ -121,4 +123,4 @@ public class Steps extends SchemaServiceRecordSteps {
String actualName = generateActualName(index, null);
super.i_should_get_object_in_search_response_without_hints_in_schema(objectInnerField, actualName, recordFile, acl, kind);
}
}
\ No newline at end of file
}
package org.opengroup.osdu.util.conf;
import java.util.Optional;
public class AnthosConfig {
private static final String GROUP_ID_VARIABLE = "GROUP_ID";
private static final String ENTITLEMENTS_DOMAIN_VARIABLE = "ENTITLEMENTS_DOMAIN";
public static void updateEntitlementsDomainVariable() {
String groupId = Optional.ofNullable(System.getProperty(GROUP_ID_VARIABLE, System.getenv(GROUP_ID_VARIABLE)))
.orElse("group");
System.setProperty(ENTITLEMENTS_DOMAIN_VARIABLE, groupId);
}
}
......@@ -9,6 +9,7 @@ import cucumber.api.java.en.When;
import lombok.extern.java.Log;
import org.opengroup.osdu.common.SchemaServiceRecordSteps;
import org.opengroup.osdu.util.ElasticUtils;
import org.opengroup.osdu.util.GCConfig;
import org.opengroup.osdu.util.GCPHTTPClient;
@Log
......@@ -20,6 +21,7 @@ public class Steps extends SchemaServiceRecordSteps {
@Before
public void before(Scenario scenario) {
GCConfig.updateEntitlementsDomainVariable();
this.scenario = scenario;
this.httpClient = new GCPHTTPClient();
}
......@@ -102,4 +104,4 @@ public class Steps extends SchemaServiceRecordSteps {
String actualName = generateActualName(index, null);
super.i_should_get_object_in_search_response_without_hints_in_schema(objectInnerField ,actualName, recordFile, acl, kind);
}
}
\ No newline at end of file
}
package org.opengroup.osdu.util;
import java.util.Optional;
public class GCConfig {
private static final String GROUP_ID_VARIABLE = "GROUP_ID";
private static final String ENTITLEMENTS_DOMAIN_VARIABLE = "ENTITLEMENTS_DOMAIN";
public static void updateEntitlementsDomainVariable() {
String groupId = Optional.ofNullable(System.getProperty(GROUP_ID_VARIABLE, System.getenv(GROUP_ID_VARIABLE)))
.orElse("group");
System.setProperty(ENTITLEMENTS_DOMAIN_VARIABLE, groupId);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment