Commit 31541957 authored by Vladislav Shishko (EPAM)'s avatar Vladislav Shishko (EPAM) Committed by Yan Sushchynski (EPAM)
Browse files

Update .gitlab-ci.yml

parent 1e7560b6
Pipeline #38583 passed with stages
in 44 seconds
...@@ -12,17 +12,25 @@ stages: ...@@ -12,17 +12,25 @@ stages:
build: build:
stage: test stage: test
variables:
TESTING_GCP_DATA_PROJECT_ID: nice-etching-277309
TESTING_GCP_BUCKET: nice-etching-277309-wddsm-gcp-lib-tests
script: script:
- echo $OSDU_GCP_INTEGRATION_TESTER | base64 -d > file.json
- export TESTING_GCP_DATA_PROJECT_CREDENTIALS=file.json
- echo ---- ---- ---- BUILD IMAGE ---- ---- ---- - echo ---- ---- ---- BUILD IMAGE ---- ---- ----
- pip3 install -r requirements.txt - pip3 install -r requirements.txt
- pip3 install -r requirements_opengroup.txt - pip3 install -r requirements_opengroup.txt
- pip3 install -r requirements_dev.txt - pip3 install -r requirements_dev.txt
- echo ---- ---- ---- UNIT TESTS ---- ---- ---- - echo ---- ---- ---- UNIT TESTS ---- ---- ----
- echo ---- DISABLED ---- pytest tests --junitxml=report.xml - pytest --junit-xml=unit_tests_report.xml --cov=osdu_gcp --cov-report=html --cov-report=xml ./tests
artifacts: artifacts:
when: always when: always
reports: reports:
junit: report.xml junit: report.xml
only:
- merge_requests
- branches
# This job only runs on master, and it creates the lib and push it to the feed # This job only runs on master, and it creates the lib and push it to the feed
deploylib: deploylib:
......
...@@ -4,10 +4,11 @@ This is the python package for osdu google cloud implementations. ...@@ -4,10 +4,11 @@ This is the python package for osdu google cloud implementations.
## testing ## testing
You need valid gcp credentials and a project ID to run the unit tests. You need valid gcp credentials, a project ID, and a bucket with test data to run the unit tests.
```bash ```bash
export TESTING_GCP_DATA_PROJECT_CREDENTIALS='path_to_jwt' export TESTING_GCP_DATA_PROJECT_CREDENTIALS='path_to_jwt'
export TESTING_GCP_DATA_PROJECT_ID='xxxx' export TESTING_GCP_DATA_PROJECT_ID='xxxx'
export TESTING_GCP_BUCKET='xxxx'
pytest pytest
``` ```
...@@ -4,3 +4,4 @@ from .test_utils import from_env ...@@ -4,3 +4,4 @@ from .test_utils import from_env
# cloud provider dependent configurations # cloud provider dependent configurations
TESTING_GCP_DATA_PROJECT_CREDENTIALS = from_env('TESTING_GCP_DATA_PROJECT_CREDENTIALS') TESTING_GCP_DATA_PROJECT_CREDENTIALS = from_env('TESTING_GCP_DATA_PROJECT_CREDENTIALS')
TESTING_GCP_DATA_PROJECT_ID = from_env('TESTING_GCP_DATA_PROJECT_ID') TESTING_GCP_DATA_PROJECT_ID = from_env('TESTING_GCP_DATA_PROJECT_ID')
TESTING_GCP_BUCKET = from_env('TESTING_GCP_BUCKET')
...@@ -36,7 +36,7 @@ async def storage_client(request): ...@@ -36,7 +36,7 @@ async def storage_client(request):
@pytest.fixture @pytest.fixture
async def test_tenant(): async def test_tenant():
return Tenant(project_id=TESTING_GCP_DATA_PROJECT_ID, bucket_name='testing-osdu-core', return Tenant(project_id=TESTING_GCP_DATA_PROJECT_ID, bucket_name=TESTING_GCP_BUCKET,
data_partition_id='testing-partition-name') data_partition_id='testing-partition-name')
...@@ -134,7 +134,7 @@ async def test_upload_empty_input(storage_client, test_tenant): ...@@ -134,7 +134,7 @@ async def test_upload_empty_input(storage_client, test_tenant):
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_upload_int_input(storage_client, test_tenant): async def test_upload_int_input(storage_client, test_tenant):
with pytest.raises(BlobStorageException): with pytest.raises(TypeError):
await storage_client.upload(test_tenant, 'int_input', 123456) await storage_client.upload(test_tenant, 'int_input', 123456)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment