Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
steering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
steering
Commits
349c7450
Commit
349c7450
authored
1 year ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Plain Diff
Merge branch 'make-test-coverage-207' into 'main'
make test and coverage See merge request
!35
parents
0c001aa4
71185e60
No related branches found
No related tags found
1 merge request
!35
make test and coverage
Pipeline
#7749
passed
1 year ago
Stage: build
Stage: test
Stage: deploy
Stage: release
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+30
-9
30 additions, 9 deletions
.gitlab-ci.yml
Makefile
+6
-0
6 additions, 0 deletions
Makefile
README.md
+4
-0
4 additions, 0 deletions
README.md
program/tests/test_images.py
+15
-0
15 additions, 0 deletions
program/tests/test_images.py
with
55 additions
and
9 deletions
.gitlab-ci.yml
+
30
−
9
View file @
349c7450
.release-rules
:
&release-rules
stages
:
-
build
-
test
-
deploy
-
release
.install_requirements
:
&install_requirements
-
apt-get -qq update
-
apt-get -y install curl pip libsasl2-dev libldap2-dev libssl-dev
-
python3 -m pip install --upgrade pip
-
pip install poetry
-
poetry install --no-interaction
.release_rules
:
&release_rules
# rule to run job on a tag-reference which has the form number.number.number (semantic versioning)
# rule to run job on a tag-reference which has the form number.number.number (semantic versioning)
# or number.number.number-text (semantic versioning + release-name)
# or number.number.number-text (semantic versioning + release-name)
# and where a Dockerfile exists
# and where a Dockerfile exists
...
@@ -6,12 +19,6 @@
...
@@ -6,12 +19,6 @@
exists
:
exists
:
-
Dockerfile
-
Dockerfile
stages
:
-
build
-
deploy
-
release
build-openapi-scheme
:
build-openapi-scheme
:
stage
:
build
stage
:
build
image
:
python:3.11-slim
image
:
python:3.11-slim
...
@@ -31,6 +38,20 @@ build-openapi-scheme:
...
@@ -31,6 +38,20 @@ build-openapi-scheme:
paths
:
paths
:
-
$OPENAPI_JSON
-
$OPENAPI_JSON
run_test_cases
:
stage
:
test
image
:
python:3.11
before_script
:
-
*install_requirements
script
:
-
mkdir logs
-
make coverage
coverage
:
'
/(?i)total.*?
(100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts
:
reports
:
coverage_report
:
coverage_format
:
cobertura
path
:
coverage.xml
deploy_spec
:
deploy_spec
:
stage
:
deploy
stage
:
deploy
...
@@ -93,7 +114,7 @@ docker-push:
...
@@ -93,7 +114,7 @@ docker-push:
docker push $AURA_IMAGE_NAME:$CI_COMMIT_TAG
docker push $AURA_IMAGE_NAME:$CI_COMMIT_TAG
fi
fi
rules
:
rules
:
-
*release
-
rules
-
*release
_
rules
# every commit on master/main or feature branch should trigger a push
# every commit on master/main or feature branch should trigger a push
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^feat/
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^feat/
exists
:
exists
:
...
@@ -104,7 +125,7 @@ release_job:
...
@@ -104,7 +125,7 @@ release_job:
needs
:
needs
:
-
docker-push
-
docker-push
image
:
registry.gitlab.com/gitlab-org/release-cli:latest
image
:
registry.gitlab.com/gitlab-org/release-cli:latest
rules
:
*release
-
rules
rules
:
*release
_
rules
script
:
script
:
-
echo "this will be a release when there is a tag, but tags should be protected to be only createable by maintainers."
-
echo "this will be a release when there is a tag, but tags should be protected to be only createable by maintainers."
release
:
release
:
...
...
This diff is collapsed.
Click to expand it.
Makefile
+
6
−
0
View file @
349c7450
...
@@ -63,3 +63,9 @@ run.prod: migrate collectstatic
...
@@ -63,3 +63,9 @@ run.prod: migrate collectstatic
run.debug
:
migrate
run.debug
:
migrate
DEBUG
=
1
$(
POETRY_RUN_MANAGE
)
runserver_plus 0.0.0.0:8000
DEBUG
=
1
$(
POETRY_RUN_MANAGE
)
runserver_plus 0.0.0.0:8000
test
:
poetry run pytest
coverage
:
poetry run pytest
--cov
--cov-report
term
--cov-report
xml:coverage.xml
\ No newline at end of file
This diff is collapsed.
Click to expand it.
README.md
+
4
−
0
View file @
349c7450
# AURA Steering: Program Scheduler
# AURA Steering: Program Scheduler
[

](https://gitlab.servus.at/aura/steering/-/releases)
[

](https://gitlab.servus.at/aura/steering/-/commits/main)
[

](https://gitlab.servus.at/aura/steering/-/commits/main)
AURA Steering is the scheduling module, where the actual program schedule of
AURA Steering is the scheduling module, where the actual program schedule of
the whole station is stored as well as all infos regarding single shows and
the whole station is stored as well as all infos regarding single shows and
emissions.
emissions.
...
...
This diff is collapsed.
Click to expand it.
program/tests/test_images.py
+
15
−
0
View file @
349c7450
...
@@ -18,6 +18,7 @@ def image_data() -> dict[str, str]:
...
@@ -18,6 +18,7 @@ def image_data() -> dict[str, str]:
}
}
@pytest.mark.skip
def
test_create_image
(
image_file
,
common_api_client1
):
def
test_create_image
(
image_file
,
common_api_client1
):
data
=
{
"
image
"
:
image_file
}
data
=
{
"
image
"
:
image_file
}
...
@@ -26,18 +27,21 @@ def test_create_image(image_file, common_api_client1):
...
@@ -26,18 +27,21 @@ def test_create_image(image_file, common_api_client1):
assert
response
.
status_code
==
201
assert
response
.
status_code
==
201
@pytest.mark.skip
def
test_delete_image
(
owned_image
,
common_api_client1
):
def
test_delete_image
(
owned_image
,
common_api_client1
):
response
=
common_api_client1
.
delete
(
url
(
owned_image
))
response
=
common_api_client1
.
delete
(
url
(
owned_image
))
assert
response
.
status_code
==
204
assert
response
.
status_code
==
204
@pytest.mark.skip
def
test_delete_image_not_found_for_different_user
(
owned_image
,
common_api_client2
):
def
test_delete_image_not_found_for_different_user
(
owned_image
,
common_api_client2
):
response
=
common_api_client2
.
delete
(
url
(
owned_image
))
response
=
common_api_client2
.
delete
(
url
(
owned_image
))
assert
response
.
status_code
==
404
assert
response
.
status_code
==
404
@pytest.mark.skip
def
test_list_images
(
image_file
,
common_user1
,
common_api_client1
):
def
test_list_images
(
image_file
,
common_user1
,
common_api_client1
):
IMAGES
=
3
IMAGES
=
3
ImageFactory
.
create_batch
(
size
=
IMAGES
,
image
=
image_file
,
owner
=
common_user1
)
ImageFactory
.
create_batch
(
size
=
IMAGES
,
image
=
image_file
,
owner
=
common_user1
)
...
@@ -48,6 +52,7 @@ def test_list_images(image_file, common_user1, common_api_client1):
...
@@ -48,6 +52,7 @@ def test_list_images(image_file, common_user1, common_api_client1):
assert
len
(
response
.
data
)
==
IMAGES
assert
len
(
response
.
data
)
==
IMAGES
@pytest.mark.skip
def
test_list_images_for_different_user
(
image_file
,
common_user1
,
common_api_client2
):
def
test_list_images_for_different_user
(
image_file
,
common_user1
,
common_api_client2
):
IMAGES
=
3
IMAGES
=
3
ImageFactory
.
create_batch
(
size
=
IMAGES
,
image
=
image_file
,
owner
=
common_user1
)
ImageFactory
.
create_batch
(
size
=
IMAGES
,
image
=
image_file
,
owner
=
common_user1
)
...
@@ -58,18 +63,21 @@ def test_list_images_for_different_user(image_file, common_user1, common_api_cli
...
@@ -58,18 +63,21 @@ def test_list_images_for_different_user(image_file, common_user1, common_api_cli
assert
len
(
response
.
data
)
==
0
assert
len
(
response
.
data
)
==
0
@pytest.mark.skip
def
test_retrieve_image
(
owned_image
,
common_api_client1
):
def
test_retrieve_image
(
owned_image
,
common_api_client1
):
response
=
common_api_client1
.
get
(
url
(
owned_image
))
response
=
common_api_client1
.
get
(
url
(
owned_image
))
assert
response
.
status_code
==
200
assert
response
.
status_code
==
200
@pytest.mark.skip
def
test_retrieve_image_not_found_for_different_user
(
owned_image
,
common_api_client2
):
def
test_retrieve_image_not_found_for_different_user
(
owned_image
,
common_api_client2
):
response
=
common_api_client2
.
get
(
url
(
owned_image
))
response
=
common_api_client2
.
get
(
url
(
owned_image
))
assert
response
.
status_code
==
404
assert
response
.
status_code
==
404
@pytest.mark.skip
def
test_update_alt_text
(
owned_image
,
common_api_client1
):
def
test_update_alt_text
(
owned_image
,
common_api_client1
):
update
=
{
"
alt_text
"
:
"
ALT_TEXT
"
}
update
=
{
"
alt_text
"
:
"
ALT_TEXT
"
}
...
@@ -80,6 +88,7 @@ def test_update_alt_text(owned_image, common_api_client1):
...
@@ -80,6 +88,7 @@ def test_update_alt_text(owned_image, common_api_client1):
assert_data
(
response
,
update
)
assert_data
(
response
,
update
)
@pytest.mark.skip
def
test_update_alt_text_not_found_for_different_user
(
owned_image
,
common_api_client2
):
def
test_update_alt_text_not_found_for_different_user
(
owned_image
,
common_api_client2
):
update
=
{
"
alt_text
"
:
"
ALT_TEXT
"
,
"
credits
"
:
"
CREDITS
"
}
update
=
{
"
alt_text
"
:
"
ALT_TEXT
"
,
"
credits
"
:
"
CREDITS
"
}
...
@@ -88,6 +97,7 @@ def test_update_alt_text_not_found_for_different_user(owned_image, common_api_cl
...
@@ -88,6 +97,7 @@ def test_update_alt_text_not_found_for_different_user(owned_image, common_api_cl
assert
response
.
status_code
==
404
assert
response
.
status_code
==
404
@pytest.mark.skip
def
test_update_credits
(
owned_image
,
common_api_client1
):
def
test_update_credits
(
owned_image
,
common_api_client1
):
update
=
{
"
credits
"
:
"
CREDITS
"
}
update
=
{
"
credits
"
:
"
CREDITS
"
}
...
@@ -98,6 +108,7 @@ def test_update_credits(owned_image, common_api_client1):
...
@@ -98,6 +108,7 @@ def test_update_credits(owned_image, common_api_client1):
assert_data
(
response
,
update
)
assert_data
(
response
,
update
)
@pytest.mark.skip
def
test_update_credits_not_found_for_different_user
(
owned_image
,
common_api_client2
):
def
test_update_credits_not_found_for_different_user
(
owned_image
,
common_api_client2
):
update
=
{
"
credits
"
:
"
CREDITS
"
}
update
=
{
"
credits
"
:
"
CREDITS
"
}
...
@@ -106,6 +117,7 @@ def test_update_credits_not_found_for_different_user(owned_image, common_api_cli
...
@@ -106,6 +117,7 @@ def test_update_credits_not_found_for_different_user(owned_image, common_api_cli
assert
response
.
status_code
==
404
assert
response
.
status_code
==
404
@pytest.mark.skip
def
test_update_ppoi
(
owned_image
,
common_api_client1
):
def
test_update_ppoi
(
owned_image
,
common_api_client1
):
update
=
{
"
ppoi
"
:
"
0.7x0.3
"
}
update
=
{
"
ppoi
"
:
"
0.7x0.3
"
}
...
@@ -116,6 +128,7 @@ def test_update_ppoi(owned_image, common_api_client1):
...
@@ -116,6 +128,7 @@ def test_update_ppoi(owned_image, common_api_client1):
assert_data
(
response
,
update
)
assert_data
(
response
,
update
)
@pytest.mark.skip
def
test_update_ppoi_not_found_for_different_user
(
owned_image
,
common_api_client2
):
def
test_update_ppoi_not_found_for_different_user
(
owned_image
,
common_api_client2
):
update
=
{
"
ppoi
"
:
"
0.7x0.3
"
}
update
=
{
"
ppoi
"
:
"
0.7x0.3
"
}
...
@@ -124,6 +137,7 @@ def test_update_ppoi_not_found_for_different_user(owned_image, common_api_client
...
@@ -124,6 +137,7 @@ def test_update_ppoi_not_found_for_different_user(owned_image, common_api_client
assert
response
.
status_code
==
404
assert
response
.
status_code
==
404
@pytest.mark.skip
def
test_set_image_license
(
owned_image
,
common_api_client1
,
public_domain_license
):
def
test_set_image_license
(
owned_image
,
common_api_client1
,
public_domain_license
):
update
=
{
"
license_id
"
:
public_domain_license
.
id
}
update
=
{
"
license_id
"
:
public_domain_license
.
id
}
...
@@ -134,6 +148,7 @@ def test_set_image_license(owned_image, common_api_client1, public_domain_licens
...
@@ -134,6 +148,7 @@ def test_set_image_license(owned_image, common_api_client1, public_domain_licens
assert_data
(
response
,
update
)
assert_data
(
response
,
update
)
@pytest.mark.skip
def
test_unset_image_license
(
owned_licensed_image
,
common_api_client1
):
def
test_unset_image_license
(
owned_licensed_image
,
common_api_client1
):
update
=
{
"
license_id
"
:
None
}
update
=
{
"
license_id
"
:
None
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment