Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
WiKoDa - Server
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
innohs_one
WiKoDa - Server
Commits
05098223
Commit
05098223
authored
3 years ago
by
Jan Bernoth
Browse files
Options
Downloads
Patches
Plain Diff
Feature/mysql testing2
parent
46e547ce
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+11
-9
11 additions, 9 deletions
.gitlab-ci.yml
.pylintrc
+1
-1
1 addition, 1 deletion
.pylintrc
articles/test_pr_upload.py
+3
-3
3 additions, 3 deletions
articles/test_pr_upload.py
one_api/settings_test.py
+6
-7
6 additions, 7 deletions
one_api/settings_test.py
with
21 additions
and
20 deletions
.gitlab-ci.yml
+
11
−
9
View file @
05098223
...
...
@@ -51,8 +51,11 @@ build-pipeline-image:
extends
:
.remote_docker
stage
:
build_pipeline_image
script
:
-
docker run --network=innohs-runner -e MYSQL_ALLOW_EMPTY_PASSWORD=true -e MYSQL_DATABASE=mise_pr -dit --name misepr-db mysql:8
-
sleep
10
-
"
echo
TEST_SECRET_KEY
>
secret_key.txt"
-
docker pull $BASEIMAGE
-
"
echo
$DB_TEST_PASSWORD
>
db_password.txt"
# https://pythonspeed.com/articles/docker-cache-insecure-images/
# using buildkit
-
DOCKER_BUILDKIT=1 docker build -t $PIPELINEIMAGE --target pipeline .
...
...
@@ -77,7 +80,7 @@ pylint:
extends
:
.remote_docker
stage
:
static_analysis
script
:
-
"
docker
run
--
rm
$PIPELINEIMAGE
pylint
--rcfile=.pylintrc
--load-plugins
pylint_django
--django-settings-module=one_api.settings_
prod
*/*.py
*/*/*.py"
-
docker run --
network=innohs-runner --rm $PIPELINEIMAGE /bin/bash -c " python manage.py migrate --settings=one_api.settings_test;
pylint --rcfile=.pylintrc --load-plugins pylint_django --django-settings-module=one_api.settings_
test
*/*.py */*/*.py"
allow_failure
:
true
except
:
refs
:
...
...
@@ -117,9 +120,8 @@ hadolint:
test-coverage-container
:
extends
:
.test-coverage-container
stage
:
test_container
allow_failure
:
true
script
:
-
docker run --rm $PIPELINEIMAGE /bin/bash -c "coverage run manage.py test --no-input --settings=one_api.settings_
prod
; coverage report */*.py */*/*.py"
-
docker run
--network=innohs-runner
--rm $PIPELINEIMAGE /bin/bash -c "
python manage.py migrate --settings=one_api.settings_test;
coverage run manage.py test --no-input --settings=one_api.settings_
test
; coverage report */*.py */*/*.py"
except
:
refs
:
-
tags
...
...
@@ -129,9 +131,9 @@ test-coverage-container-prod:
extends
:
.test-coverage-container
stage
:
test_container_prod
script
:
-
docker run --rm $APPIMAGE /bin/bash -c "coverage run manage.py test --no-input --settings=one_api.settings_prod; coverage report */*.py */*/*.py"
-
docker run --rm $APPIMAGE /bin/bash -c "coverage run manage.py test --no-input --settings=one_api.settings_prod; coverage report */*.py */*/*.py"
only
:
-
master
-
master
except
:
refs
:
-
tags
...
...
@@ -142,10 +144,11 @@ test-coverage-container-prod:
stage
:
test_container
test-container
:
after_script
:
-
docker stop misepr-db && docker rm misepr-db
extends
:
.test-container
allow_failure
:
true
script
:
-
docker run --
rm $PIPELINEIMAGE
python manage.py test --no-input --settings=one_api.settings_
prod
-
docker run --
network=innohs-runner --rm $PIPELINEIMAGE /bin/bash -c "python manage.py migrate --settings=one_api.settings_test ;
python manage.py test --no-input --settings=one_api.settings_
test"
except
:
refs
:
-
tags
...
...
@@ -154,12 +157,11 @@ test-container:
test-container-prod
:
extends
:
.test-container
stage
:
test_container_prod
allow_failure
:
true
script
:
-
docker run --rm $APPIMAGE python manage.py test --no-input --settings=one_api.settings_prod
only
:
-
master
except
:
except
:
refs
:
-
tags
...
...
This diff is collapsed.
Click to expand it.
.pylintrc
+
1
−
1
View file @
05098223
...
...
@@ -24,7 +24,7 @@ ignore=CVS
# Add files or directories matching the regex patterns to the ignore-list. The
# regex matches against paths.
ignore-paths=.*migrations/.*
ignore-paths=.*migrations/.*
,bin/.*
# Files or directories matching the regex patterns are skipped. The regex
# matches against base names, not paths.
...
...
This diff is collapsed.
Click to expand it.
articles/test_pr_upload.py
+
3
−
3
View file @
05098223
...
...
@@ -84,9 +84,9 @@ class DbHandler(TransactionTestCase):
logger
.
info
(
"
started test_write_articles_name
"
)
file
=
Files
.
objects
.
get
(
upload_file
=
'
testfile.pdf
'
)
input_data
=
{
'
medium_name
'
:
'
M
A
Z
'
,
'
medium_name
'
:
'
M
O
Z
'
,
'
medium_type
'
:
'
Zeitung
'
,
'
name
'
:
'
Testartikel
'
,
'
name
'
:
'
Testartikel
1
'
,
'
source_file
'
:
file
,
'
reach
'
:
1000
,
'
date_of_publication
'
:
'
1988-12-30
'
,
...
...
@@ -96,7 +96,7 @@ class DbHandler(TransactionTestCase):
'
tags
'
:
[
'
tag1
'
,
'
tag2
'
]
}
write_article_to_db
(
**
input_data
)
article
=
Article
.
objects
.
get
(
name
=
'
Testartikel
'
)
article
=
Article
.
objects
.
get
(
name
=
'
Testartikel
1
'
)
self
.
assertEqual
(
article
.
reach
,
1000
)
def
test_write_articles_title
(
self
):
...
...
This diff is collapsed.
Click to expand it.
one_api/settings_test.py
+
6
−
7
View file @
05098223
...
...
@@ -8,13 +8,12 @@ except ImportError as e:
DATABASES
=
{
'
default
'
:
{
'
ENGINE
'
:
'
django.db.backends.sql
ite3
'
,
'
NAME
'
:
''
,
'
USER
'
:
''
,
'
PASSWORD
'
:
''
,
'
HOST
'
:
''
,
'
PORT
'
:
''
'
ENGINE
'
:
'
django.db.backends.
my
sql
'
,
'
NAME
'
:
'
mise_pr
'
,
'
USER
'
:
'
root
'
,
#
'PASSWORD':,
'
HOST
'
:
'
misepr-db
'
,
'
PORT
'
:
'
3306
'
}
}
SECRET_KEY
=
secrets
.
token_hex
(
16
)
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