Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
callidus
Machina Callida
Commits
a2fa2be4
Commit
a2fa2be4
authored
Apr 30, 2020
by
Konstantin Schulz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplified CI for the backend
parent
34029c73
Pipeline
#11434
failed with stages
in 3 minutes and 3 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
.gitlab-ci.yml
.gitlab-ci.yml
+1
-1
ci_backend.sh
ci_backend.sh
+0
-1
mc_backend/tests.py
mc_backend/tests.py
+7
-1
No files found.
.gitlab-ci.yml
View file @
a2fa2be4
...
...
@@ -16,7 +16,7 @@ ci_frontend:
ci_backend
:
stage
:
ci
script
:
-
./
ci_backend.
sh
-
docker-compose run --rm mcserver bash -c "source ../venv/bin/activate && coverage run --rcfile=.coveragerc tests.py && coverage combine && coverage report -m" >
ci_backend.
log
artifacts
:
paths
:
-
ci_backend.log
...
...
ci_backend.sh
deleted
100755 → 0
View file @
34029c73
docker-compose run
--rm
mcserver bash
-c
"source ../venv/bin/activate && coverage run --rcfile=.coveragerc tests.py && coverage combine && coverage report -m"
>
ci_backend.log
mc_backend/tests.py
View file @
a2fa2be4
...
...
@@ -998,13 +998,19 @@ class CommonTestCase(unittest.TestCase):
def
test_init_stop_words_latin
(
self
):
"""Initializes the stop words list for Latin texts and caches it if necessary."""
def
clear_cache
():
if
os
.
path
.
exists
(
Config
.
STOP_WORDS_LATIN_PATH
):
os
.
remove
(
Config
.
STOP_WORDS_LATIN_PATH
)
clear_cache
()
stop_word_list
:
Dict
[
str
,
List
[
str
]]
=
{
"a"
:
[
"b"
]}
mr
:
MockResponse
=
MockResponse
(
json
.
dumps
(
stop_word_list
))
with
patch
.
object
(
mcserver
.
app
.
services
.
textService
.
requests
,
"get"
,
return_value
=
mr
)
as
mock_get_request
:
TextService
.
init_stop_words_latin
()
self
.
assertEqual
(
len
(
TextService
.
stop_words_latin
),
1
)
TextService
.
init_stop_words_latin
()
os
.
remove
(
Config
.
STOP_WORDS_LATIN_PATH
)
clear_cache
(
)
self
.
assertEqual
(
mock_get_request
.
call_count
,
1
)
def
test_load_text_list
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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