Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
hive
hivemind
Commits
51060b19
Commit
51060b19
authored
4 years ago
by
Bartek Wrona
Browse files
Options
Downloads
Plain Diff
Merge branch 'escaping_fix' into 'develop'
fixed unicode escaping See merge request
!113
parents
92b1f823
9d4632f0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
5 merge requests
!456
Release candidate v1 24
,
!230
Setup monitoring with pghero
,
!138
Small typos fixed
,
!135
Enable postgres monitoring on CI server
,
!113
fixed unicode escaping
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yaml
+23
-2
23 additions, 2 deletions
.gitlab-ci.yaml
hive/utils/normalize.py
+14
-12
14 additions, 12 deletions
hive/utils/normalize.py
tests/tests_api
+1
-1
1 addition, 1 deletion
tests/tests_api
with
38 additions
and
15 deletions
.gitlab-ci.yaml
+
23
−
2
View file @
51060b19
...
...
@@ -194,11 +194,21 @@ condenser_api_smoketest:
reports
:
junit
:
api_smoketest_condenser_api.xml
database_api_smoketest_old
:
<<
:
*common_api_smoketest_job
script
:
-
scripts/ci_start_api_smoketest.sh localhost "$HIVEMIND_HTTP_PORT" test_database_api_patterns.tavern.yaml api_smoketest_database_api_old.xml
artifacts
:
reports
:
junit
:
api_smoketest_database_api_old.xml
database_api_smoketest
:
<<
:
*common_api_smoketest_job
script
:
-
scripts/ci_start_api_smoketest.sh localhost "$HIVEMIND_HTTP_PORT"
test_
database_api_patterns
.tavern.yaml
api_smoketest_database_api.xml
-
scripts/ci_start_api_smoketest.sh localhost "$HIVEMIND_HTTP_PORT" database_api_patterns
/
api_smoketest_database_api.xml
artifacts
:
reports
:
...
...
@@ -214,13 +224,24 @@ follow_api_smoketest:
reports
:
junit
:
api_smoketest_follow_api.xml
tags_api_smoketest_old
:
<<
:
*common_api_smoketest_job
script
:
-
scripts/ci_start_api_smoketest.sh localhost "$HIVEMIND_HTTP_PORT" test_tags_api_patterns.tavern.yaml api_smoketest_tags_api_old.xml
artifacts
:
reports
:
junit
:
api_smoketest_tags_api_old.xml
tags_api_smoketest
:
<<
:
*common_api_smoketest_job
script
:
-
scripts/ci_start_api_smoketest.sh localhost "$HIVEMIND_HTTP_PORT"
test_
tags_api_patterns
.tavern.yaml
api_smoketest_tags_api.xml
-
scripts/ci_start_api_smoketest.sh localhost "$HIVEMIND_HTTP_PORT" tags_api_patterns
/
api_smoketest_tags_api.xml
artifacts
:
reports
:
junit
:
api_smoketest_tags_api.xml
This diff is collapsed.
Click to expand it.
hive/utils/normalize.py
+
14
−
12
View file @
51060b19
...
...
@@ -29,6 +29,7 @@ UNIT_NAI = {
# convert special chars into their octal formats recognized by sql
SPECIAL_CHARS
=
{
"
\x00
"
:
"
"
,
# nul char cannot be stored in string column (ABW: if we ever find the need to store nul chars we'll need bytea, not text)
"
\r
"
:
"
\\
015
"
,
"
\n
"
:
"
\\
012
"
,
"
\v
"
:
"
\\
013
"
,
...
...
@@ -74,20 +75,21 @@ def escape_characters(text):
ret
=
"
E
'"
for
ch
in
text
:
if
ch
.
isprintable
()
or
ch
in
SPECIAL_CHARS
:
try
:
dw
=
SPECIAL_CHARS
[
ch
]
ret
=
ret
+
dw
except
KeyError
:
ret
=
ret
+
ch
if
ch
in
SPECIAL_CHARS
:
dw
=
SPECIAL_CHARS
[
ch
]
ret
=
ret
+
dw
elif
ch
.
isprintable
():
ret
=
ret
+
ch
else
:
# escaped_value = ch.encode('unicode-escape').decode('utf-8')
ordinal
=
ord
(
ch
)
if
ordinal
==
0
or
ordinal
>=
0x80
:
escaped_value
=
'
u
'
+
hex
(
ordinal
)[
2
:]
# logging.info("Encoded unicode escape: {}".format(escaped_value))
else
:
escaped_value
=
ch
.
encode
(
'
unicode-escape
'
).
decode
(
'
utf-8
'
)
hexstr
=
hex
(
ordinal
)[
2
:]
escaped_value
=
'
\\
u
'
i
=
len
(
hexstr
)
while
i
<
4
:
escaped_value
+=
'
0
'
i
+=
1
escaped_value
+=
hexstr
ret
=
ret
+
escaped_value
ret
=
ret
+
"'"
...
...
This diff is collapsed.
Click to expand it.
tests_api
@
7d925b4e
Compare
c673b555
...
7d925b4e
Subproject commit
c673b555aa055358e0f5a1e1401a4110f7f83ca3
Subproject commit
7d925b4e88faafd6d0154725bfe26d7bdfaee23f
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