From 762dd91f4e5e0df831149fa8cbdb6250013fce40 Mon Sep 17 00:00:00 2001 From: ashishj1729 Date: Tue, 6 Dec 2022 14:26:19 +0530 Subject: [PATCH] Addition of Tox.ini and License Headers Issue-Id: AIMLFW-5 Signed-off-by: ashishj1729 Change-Id: I3b4b7637bca27c83f2c0a8bde67907b3f815af2b --- test/SparkConfig.ini | 18 +++++++++++++ test/requirements_tests.txt | 21 ++++++++++++++- test/sink/SinkClassConfig.ini | 18 +++++++++++++ test/source/SourceClassConfig.ini | 18 +++++++++++++ test/test_env.env | 18 +++++++++++++ test/transform/TransformClassConfig.ini | 18 +++++++++++++ tox.ini | 46 +++++++++++++++++++++++++++++++++ 7 files changed, 156 insertions(+), 1 deletion(-) create mode 100644 tox.ini diff --git a/test/SparkConfig.ini b/test/SparkConfig.ini index 7ee005b..5aff802 100644 --- a/test/SparkConfig.ini +++ b/test/SparkConfig.ini @@ -1,3 +1,21 @@ +# ================================================================================== +# +# Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ================================================================================== + [BaseConfig] DefaultAppName=Pipeline DefaultMaster=local[1] diff --git a/test/requirements_tests.txt b/test/requirements_tests.txt index 867c022..eeb1712 100644 --- a/test/requirements_tests.txt +++ b/test/requirements_tests.txt @@ -1,3 +1,21 @@ +# ================================================================================== +# +# Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ================================================================================== + pytest-cov python-dotenv pyspark @@ -9,4 +27,5 @@ Flask-RESTful==0.3.9 lru-dict==1.1.7 influxdb_client mock -pandas \ No newline at end of file +pandas +PyYAML \ No newline at end of file diff --git a/test/sink/SinkClassConfig.ini b/test/sink/SinkClassConfig.ini index 7a12e9a..a00ee13 100644 --- a/test/sink/SinkClassConfig.ini +++ b/test/sink/SinkClassConfig.ini @@ -1,3 +1,21 @@ +# ================================================================================== +# +# Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ================================================================================== + [ModuleDetails] ModuleName=sink BaseClassName=Sink diff --git a/test/source/SourceClassConfig.ini b/test/source/SourceClassConfig.ini index 5e44f6a..15ff6b5 100644 --- a/test/source/SourceClassConfig.ini +++ b/test/source/SourceClassConfig.ini @@ -1,3 +1,21 @@ +# ================================================================================== +# +# Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ================================================================================== + [InfluxSource] Name=Influxdb Description= Spark connector that Supports Reading from InfluxDB diff --git a/test/test_env.env b/test/test_env.env index 9492f6f..bae3aaf 100644 --- a/test/test_env.env +++ b/test/test_env.env @@ -1,3 +1,21 @@ +# ================================================================================== +# +# Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ================================================================================== + #change the values accordingly and all these env variables via 'source' command FS_API_HOST='' FS_API_PORT=1111 diff --git a/test/transform/TransformClassConfig.ini b/test/transform/TransformClassConfig.ini index 9f2f398..c63fa4b 100644 --- a/test/transform/TransformClassConfig.ini +++ b/test/transform/TransformClassConfig.ini @@ -1,3 +1,21 @@ +# ================================================================================== +# +# Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ================================================================================== + [SQLTransform] Name=SQLTransformer Description= SQLTransformer Transforms your data using SQL statements diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..5b751e5 --- /dev/null +++ b/tox.ini @@ -0,0 +1,46 @@ +# ================================================================================== +# +# Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ================================================================================== + +[tox] +envlist = code +skipsdist = true + +# basic test and coverage job +[testenv:code] +basepython = python3.8 +deps= + pytest + coverage + pytest-cov + mock + pandas + python-dotenv + pyspark + influxdb_client + cassandra-driver + jsonpickle + Flask + Flask-API + Flask-RESTful + lru-dict + PyYAML + + +commands = + pytest --cov-report term-missing --cov-report xml --cov-report html --cov-fail-under=30 --junitxml=/tmp/tests.xml --cov={toxinidir}/dataextraction/ + coverage xml -i -- 2.16.6