Skip to content
Snippets Groups Projects
Commit 350e0d63 authored by Corné Lukken's avatar Corné Lukken
Browse files

Resolve TMSS-3170 "3"

parent d42f38ed
No related branches found
No related tags found
1 merge request!3Resolve TMSS-3170 "3"
Showing
with 40 additions and 40 deletions
......@@ -15,7 +15,7 @@ docs/source/source_documentation
docs/build
# Setuptools SCM
pycommon/_version.py
tmss_pycommon/_version.py
# IDE configuration
.vscode
......
......@@ -123,8 +123,8 @@ docker_build:
before_script: []
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -f docker/pycommon/Dockerfile . --build-arg BUILD_ENV=copy --tag $CI_REGISTRY_IMAGE/pycommon:$CI_COMMIT_REF_SLUG
- docker push $CI_REGISTRY_IMAGE/pycommon:$CI_COMMIT_REF_SLUG
- docker build -f docker/tmss_pycommon/Dockerfile . --build-arg BUILD_ENV=copy --tag $CI_REGISTRY_IMAGE/tmss_pycommon:$CI_COMMIT_REF_SLUG
- docker push $CI_REGISTRY_IMAGE/tmss_pycommon:$CI_COMMIT_REF_SLUG
run_integration_tests:
stage: integration
......
File moved
......@@ -7,7 +7,7 @@ requires = [
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
version_file = "pycommon/_version.py"
version_file = "tmss_pycommon/_version.py"
[tool.pylint]
ignore = "_version.py"
[metadata]
name = pycommon
name = tmss-pycommon
description = PyCommon package for TMSS backend
long_description = file: README.md
long_description_content_type = text/markdown
......
from pycommon import isProductionEnvironment
from tmss_pycommon import isProductionEnvironment
if isProductionEnvironment():
print("The test modules in %s should not be imported and used in a lofar production environment" % __package__)
......
......@@ -5,7 +5,7 @@ import os
import uuid
import logging
from pycommon.dbcredentials import Credentials, DBCredentials
from tmss_pycommon.dbcredentials import Credentials, DBCredentials
logger = logging.getLogger(__name__)
......
......@@ -8,10 +8,10 @@ import logging
import psycopg2
import testing.postgresql
from pycommon.dbcredentials import Credentials
from pycommon.postgres import PostgresDatabaseConnection
from pycommon.util import find_free_port
from pycommon.locking import NamedAtomicLock
from tmss_pycommon.dbcredentials import Credentials
from tmss_pycommon.postgres import PostgresDatabaseConnection
from tmss_pycommon.util import find_free_port
from tmss_pycommon.locking import NamedAtomicLock
from tests.dbcredentials import TemporaryCredentials
......
......@@ -3,8 +3,8 @@
import unittest
from pycommon.cache import cache
from pycommon.test_utils import unit_test, exit_with_skipped_code_if_skip_unit_tests
from tmss_pycommon.cache import cache
from tmss_pycommon.test_utils import unit_test, exit_with_skipped_code_if_skip_unit_tests
exit_with_skipped_code_if_skip_unit_tests()
......
......@@ -5,9 +5,9 @@ import unittest
from subprocess import call
import logging
from pycommon.cep4_utils import *
from pycommon.test_utils import integration_test
from pycommon.test_utils import exit_with_skipped_code_if_skip_integration_tests
from tmss_pycommon.cep4_utils import *
from tmss_pycommon.test_utils import integration_test
from tmss_pycommon.test_utils import exit_with_skipped_code_if_skip_integration_tests
exit_with_skipped_code_if_skip_integration_tests()
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.DEBUG)
......
......@@ -4,10 +4,10 @@
import unittest
import logging
from pycommon.cobaltblocksize import (
from tmss_pycommon.cobaltblocksize import (
StokesSettings, CorrelatorSettings, BlockConstraints, BlockSize
)
from pycommon.test_utils import unit_test
from tmss_pycommon.test_utils import unit_test
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO)
logger = logging.getLogger(__name__)
......
......@@ -7,9 +7,9 @@ import tempfile
from uuid import uuid4
from configparser import NoSectionError
from pycommon.test_utils import exit_with_skipped_code_if_skip_unit_tests
from pycommon.test_utils import unit_test
from pycommon.dbcredentials import *
from tmss_pycommon.test_utils import exit_with_skipped_code_if_skip_unit_tests
from tmss_pycommon.test_utils import unit_test
from tmss_pycommon.dbcredentials import *
exit_with_skipped_code_if_skip_unit_tests()
......
......@@ -4,9 +4,9 @@
import unittest
import tempfile
from pycommon.test_utils import exit_with_skipped_code_if_skip_unit_tests
from pycommon.test_utils import unit_test
from pycommon.defaultmailaddresses import PipelineEmailConfig
from tmss_pycommon.test_utils import exit_with_skipped_code_if_skip_unit_tests
from tmss_pycommon.test_utils import unit_test
from tmss_pycommon.defaultmailaddresses import PipelineEmailConfig
exit_with_skipped_code_if_skip_unit_tests()
......
......@@ -6,8 +6,8 @@ import threading
import json
import logging
from pycommon.test_utils import exit_with_skipped_code_if_skip_unit_tests
from pycommon.json_utils import (
from tmss_pycommon.test_utils import exit_with_skipped_code_if_skip_unit_tests
from tmss_pycommon.json_utils import (
get_default_json_object_for_schema, replace_host_in_urls, resolved_remote_refs,
resolved_local_refs, get_sub_schema, raise_on_self_refs
)
......@@ -229,7 +229,7 @@ class TestJSONUtils(unittest.TestCase):
'''test if $refs to URL's are properly resolved'''
import http.server
import socketserver
from pycommon.util import find_free_port
from tmss_pycommon.util import find_free_port
port = find_free_port(8000, allow_reuse_of_lingering_port=False)
host = "127.0.0.1"
......@@ -395,7 +395,7 @@ class TestJSONUtils(unittest.TestCase):
'''test if ambiguous $refs raise'''
import http.server
import socketserver
from pycommon.util import find_free_port
from tmss_pycommon.util import find_free_port
port = find_free_port(8000, allow_reuse_of_lingering_port=False)
host = "127.0.0.1"
......
......@@ -5,9 +5,9 @@ from threading import Thread
import time
import unittest
from pycommon.test_utils import exit_with_skipped_code_if_skip_unit_tests
from pycommon.methodtrigger import MethodTrigger
from pycommon.test_utils import unit_test
from tmss_pycommon.test_utils import exit_with_skipped_code_if_skip_unit_tests
from tmss_pycommon.methodtrigger import MethodTrigger
from tmss_pycommon.test_utils import unit_test
exit_with_skipped_code_if_skip_unit_tests()
......
from unittest import TestCase
from pycommon.parameterset import parameterset
from tmss_pycommon.parameterset import parameterset
class TestParameterSet(TestCase):
......
......@@ -9,9 +9,9 @@ from unittest import mock
import psycopg2
from pycommon.test_utils import exit_with_skipped_code_if_skip_integration_tests
from pycommon.postgres import *
from pycommon.test_utils import integration_test
from tmss_pycommon.test_utils import exit_with_skipped_code_if_skip_integration_tests
from tmss_pycommon.postgres import *
from tmss_pycommon.test_utils import integration_test
from tests.postgres import PostgresTestDatabaseInstance, PostgresTestMixin
exit_with_skipped_code_if_skip_integration_tests()
......@@ -45,7 +45,7 @@ class TestPostgres(MyPostgresTestMixin, unittest.TestCase):
incorrect_dbcreds.port += 1
# test if connecting fails
with mock.patch('pycommon.database.logger') as mocked_logger:
with mock.patch('tmss_pycommon.database.logger') as mocked_logger:
with self.assertRaises(DatabaseConnectionError):
NUM_CONNECT_RETRIES = 2
with PostgresDatabaseConnection(dbcreds=incorrect_dbcreds, connect_retry_interval=0.1, num_connect_retries=NUM_CONNECT_RETRIES) as db:
......
# Copyright (C) 2024 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: GPL-3.0-or-later
from pycommon.test_utils import *
from tmss_pycommon.test_utils import *
exit_with_skipped_code_if_skip_unit_tests()
......
......@@ -3,8 +3,8 @@
import unittest
from pycommon.toposort import Graph, toposorted
from pycommon.test_utils import unit_test
from tmss_pycommon.toposort import Graph, toposorted
from tmss_pycommon.test_utils import unit_test
class TestGraph(unittest.TestCase):
......
......@@ -4,7 +4,7 @@
import unittest
import logging
from pycommon.typing import check_type_hints
from tmss_pycommon.typing import check_type_hints
logger = logging.getLogger(__name__)
logging.basicConfig(format='%(asctime)s %(process)s %(threadName)s %(levelname)s %(message)s', level=logging.DEBUG)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment