Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CaosDB Python Integration Tests
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
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
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Python Integration Tests
Commits
fe569ebd
Verified
Commit
fe569ebd
authored
2 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: timezone
parent
16ac853e
No related branches found
No related tags found
1 merge request
!43
BUG: setup timezone in deploy
Pipeline
#27259
failed
2 years ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
3
Pipelines
4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.docker/docker-compose.yml
+1
-0
1 addition, 0 deletions
.docker/docker-compose.yml
.docker/tester_pycaosdb.ini
+2
-0
2 additions, 0 deletions
.docker/tester_pycaosdb.ini
tests/test_misc.py
+34
-2
34 additions, 2 deletions
tests/test_misc.py
with
37 additions
and
2 deletions
.docker/docker-compose.yml
+
1
−
0
View file @
fe569ebd
...
...
@@ -32,6 +32,7 @@ services:
-
"
10080:10080"
environment
:
DEBUG
:
1
DOCKER_TZ
:
"
Cuba"
CAOSDB_CONFIG_AUTHTOKEN_CONFIG
:
"
conf/core/authtoken.example.yaml"
CAOSDB_CONFIG_TRANSACTION_BENCHMARK_ENABLED
:
"
TRUE"
CAOSDB_CONFIG__CAOSDB_INTEGRATION_TEST_SUITE_KEY
:
_CAOSDB_PYINTTEST_SUITE
...
...
This diff is collapsed.
Click to expand it.
.docker/tester_pycaosdb.ini
+
2
−
0
View file @
fe569ebd
...
...
@@ -18,6 +18,8 @@ test_authentication.admin_token_crud = /authtoken/admin_token_crud.txt
test_authentication.admin_token_expired
=
/authtoken/admin_token_expired.txt
test_authentication.admin_token_3_attempts
=
/authtoken/admin_token_3_attempts.txt
; magic time zone of the server
test_misc.test_time_zone.time_zone
=
Cuba
[Connection]
url
=
https://caosdb-server:10443/
...
...
This diff is collapsed.
Click to expand it.
tests/test_misc.py
+
34
−
2
View file @
fe569ebd
...
...
@@ -28,8 +28,7 @@ import caosdb as db
from
caosdb
import
(
Container
,
Info
,
Property
,
Record
,
RecordType
,
execute_query
,
administration
as
admin
)
from
caosdb.utils.register_tests
import
set_test_key
,
clear_database
from
pytest
import
raises
from
pytest
import
mark
from
pytest
import
raises
,
mark
,
fixture
set_test_key
(
"
_CAOSDB_PYINTTEST_SUITE
"
)
...
...
@@ -422,3 +421,36 @@ def test_retrieve_wrong_role(clear_database):
"
intialized with a wrong class by this client
"
"
or it has changed in the past and this
"
"
client did
'
t know about it yet.
"
)
@fixture
def
reset_time_zone
():
yield
None
server_time_zone
=
db
.
get_config
().
get
(
"
IntegrationTests
"
,
"
test_misc.test_time_zone.time_zone
"
)
if
server_time_zone
is
not
None
:
admin
.
set_server_property
(
"
TIMEZONE
"
,
server_time_zone
)
def
test_time_zone
(
reset_time_zone
):
server_time_zone
=
db
.
get_config
().
get
(
"
IntegrationTests
"
,
"
test_misc.test_time_zone.time_zone
"
)
if
server_time_zone
is
not
None
:
assert
admin
.
get_server_property
(
"
TIMEZONE
"
)
==
server_time_zone
,
"
If this test fails locally, try to re-run it
"
admin
.
set_server_property
(
"
TIMEZONE
"
,
"
UTC
"
)
assert
db
.
Info
().
time_zone
.
offset
==
"
+0000
"
admin
.
set_server_property
(
"
TIMEZONE
"
,
"
Etc/GMT+5
"
)
# Standard Time NY
gmt_plus_5
=
db
.
Info
().
time_zone
.
offset
assert
gmt_plus_5
==
"
-0500
"
# Today I learned: POSIX defines GMT+X as UTC-X (... no words...)
admin
.
set_server_property
(
"
TIMEZONE
"
,
"
EST
"
)
assert
db
.
Info
().
time_zone
.
offset
==
gmt_plus_5
admin
.
set_server_property
(
"
TIMEZONE
"
,
"
Etc/GMT-1
"
)
# Standard Time Berlin
assert
db
.
Info
().
time_zone
.
offset
==
"
+0100
"
admin
.
set_server_property
(
"
TIMEZONE
"
,
"
Etc/GMT-14
"
)
# Kiritimati
assert
db
.
Info
().
time_zone
.
offset
==
"
+1400
"
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