Skip to content
Snippets Groups Projects
Commit de74cdc5 authored by Azlan Sapeei's avatar Azlan Sapeei
Browse files

Update readme and integration token

parent 1d54c661
No related branches found
No related tags found
Loading
Pipeline #293410 failed
### Running E2E Tests
You will need to have the following environment variables defined.
| name | value | description | sensitive? | source |
|--------------------------------------|--------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------|--------|
| `HOST_URL` | ex `https://osdu.core-dev.gcp.gnrg-osdu.projects.epam.com/api/legal/v1/` | - | yes | - |
| `MY_TENANT` | ex `osdu` | OSDU tenant used for testing | yes | - |
| `SKIP_HTTP_TESTS` | ex `true` | jetty server returns 403 when running locally when deployed jettyserver is not used and the app returns a 302 so just run against deployed version only when checking http -> https redirects. Use 'true' for Google Cloud Run | yes | - |
| `BAREMETAL_PROJECT_ID` | ex `osdu-cim-dev` | project id used to specify bucket name if `ENABLE_FULL_BUCKET_NAME`=true | no | - |
| `TEST_MINIO_ACCESS_KEY` | ex `admin` | Minio access key | no | - |
| `TEST_MINIO_SECRET_KEY` | `********` | Minio secret | yes | -- |
| `TEST_MINIO_URL` | ex `https://s3.core-dev.gcp.gnrg-osdu.projects.epam.com` | Minio url | -- |
| `PARTITION_API` | ex `https://osdu.core-dev.gcp.gnrg-osdu.projects.epam.com/api/partition/v1` | Partition service host | no | -- |
Authentication can be provided as OIDC config:
| name | value | description | sensitive? | source |
|-------------------------------------------------|-----------------------------------------|-------------------------------|------------|--------|
| `TEST_OPENID_PROVIDER_CLIENT_ID` | `********` | PRIVILEGED_USER Client Id | yes | - |
| `TEST_OPENID_PROVIDER_CLIENT_SECRET` | `********` | PRIVILEGED_USER Client secret | yes | - |
| `TEST_OPENID_PROVIDER_URL` | `https://keycloak.com/auth/realms/osdu` | OpenID provider url | yes | - |
Or tokens can be used directly from env variables:
| name | value | description | sensitive? | source |
|-------------------------|------------|-----------------------|------------|--------|
| `TEST_USER_TOKEN` | `********` | PRIVILEGED_USER Token | yes | - |
**Entitlements configuration for integration accounts**
| INTEGRATION_TESTER |
|------------------------------------------------------------------------------------------------------------------------------------------------------|
| users<br/>service.entitlements.user<br/>service.legal.admin<br/>service.legal.editor<br/>service.legal.user<br/>data.test1<br/>data.integration.test |
Execute following command to build code and run all the integration tests:
```bash
# Note: this assumes that the environment variables for integration tests as outlined
# above are already exported in your environment.
$ (cd testing/legal-test-core/ && mvn clean install)
$ (cd testing/legal-test-baremetal/ && mvn clean test)
```
## License
Copyright © Google LLC
Copyright © EPAM Systems
Copyright © ExxonMobil
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
[http://www.apache.org/licenses/LICENSE-2.0](http://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.
...@@ -16,10 +16,12 @@ import com.sun.jersey.api.client.ClientResponse; ...@@ -16,10 +16,12 @@ import com.sun.jersey.api.client.ClientResponse;
public class LegalTagUtils extends TestUtils { public class LegalTagUtils extends TestUtils {
public static final String INTEGRATION_TESTER_TOKEN = "TEST_USER_TOKEN";
protected static String token = null; protected static String token = null;
private OpenIDTokenProvider tokenProvider; private OpenIDTokenProvider tokenProvider;
public LegalTagUtils() { public LegalTagUtils() {
token = System.getProperty(INTEGRATION_TESTER_TOKEN, System.getenv(INTEGRATION_TESTER_TOKEN));
if (Strings.isNullOrEmpty(token)) { if (Strings.isNullOrEmpty(token)) {
tokenProvider = new OpenIDTokenProvider(); tokenProvider = new OpenIDTokenProvider();
token = tokenProvider.getToken(); token = tokenProvider.getToken();
......
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