Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
Domain Data Management Services
Wellbore
Lib
Wellbore-cloud
Wellbore-gcp-lib
Commits
03154703
Commit
03154703
authored
May 05, 2021
by
Oleksandr Kosse (EPAM)
Browse files
Merge branch 'gcp_tests' into 'master'
(GONRG-2124) Update gcp-test .gitlab-ci.yml See merge request
!9
parents
1e7560b6
31541957
Pipeline
#38593
failed with stages
in 54 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
03154703
...
...
@@ -12,17 +12,25 @@ stages:
build
:
stage
:
test
variables
:
TESTING_GCP_DATA_PROJECT_ID
:
nice-etching-277309
TESTING_GCP_BUCKET
:
nice-etching-277309-wddsm-gcp-lib-tests
script
:
-
echo $OSDU_GCP_INTEGRATION_TESTER | base64 -d > file.json
-
export TESTING_GCP_DATA_PROJECT_CREDENTIALS=file.json
-
echo ---- ---- ---- BUILD IMAGE ---- ---- ----
-
pip3 install -r requirements.txt
-
pip3 install -r requirements_opengroup.txt
-
pip3 install -r requirements_dev.txt
-
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
:
when
:
always
reports
:
junit
:
report.xml
only
:
-
merge_requests
-
branches
# This job only runs on master, and it creates the lib and push it to the feed
deploylib
:
...
...
README.md
View file @
03154703
...
...
@@ -4,10 +4,11 @@ This is the python package for osdu google cloud implementations.
## 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
export
TESTING_GCP_DATA_PROJECT_CREDENTIALS
=
'path_to_jwt'
export
TESTING_GCP_DATA_PROJECT_ID
=
'xxxx'
export
TESTING_GCP_BUCKET
=
'xxxx'
pytest
```
tests/conftest.py
View file @
03154703
...
...
@@ -4,3 +4,4 @@ from .test_utils import from_env
# cloud provider dependent configurations
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_BUCKET
=
from_env
(
'TESTING_GCP_BUCKET'
)
tests/storage/test_blob_storage_gcp.py
View file @
03154703
...
...
@@ -36,7 +36,7 @@ async def storage_client(request):
@
pytest
.
fixture
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'
)
...
...
@@ -134,7 +134,7 @@ async def test_upload_empty_input(storage_client, test_tenant):
@
pytest
.
mark
.
asyncio
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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment