diff --git a/daksha/asgi.py b/daksha/asgi.py index 19ad035..d849370 100644 --- a/daksha/asgi.py +++ b/daksha/asgi.py @@ -1,32 +1,32 @@ -""" -Daksha -Copyright (C) 2021 myKaarma. -opensource@mykaarma.com -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -""" -""" -ASGI config for daksha project. - -It exposes the ASGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ -""" - -import os - -from django.core.asgi import get_asgi_application - -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'daksha.settings') - -application = get_asgi_application() +""" +Daksha +Copyright (C) 2021 myKaarma. +opensource@mykaarma.com +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + +""" +""" +ASGI config for daksha project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'daksha.settings') + +application = get_asgi_application() diff --git a/daksha/settings.py b/daksha/settings.py index 474a337..6cd2d35 100644 --- a/daksha/settings.py +++ b/daksha/settings.py @@ -1,231 +1,231 @@ -""" -Daksha -Copyright (C) 2021 myKaarma. -opensource@mykaarma.com -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -""" -""" -Django settings for daksha project. - -Generated by 'django-admin startproject' using Django 3.0.9. - -For more information on this file, see -https://docs.djangoproject.com/en/3.0/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/3.0/ref/settings/ -""" - -import os -import yaml -from reportportal_client import RPClient -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', 'gj%7t91&c$*q&+fkx-wuug^i$0b@@lk26vd4txdq=)%_319hyy') - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = False - -ALLOWED_HOSTS = [ - '127.0.0.1' -] -CUSTOM_ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '').split(sep=',') -ALLOWED_HOSTS.extend(CUSTOM_ALLOWED_HOSTS) -# Application definition - -INSTALLED_APPS = [ - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', - 'engine', - 'django_crontab' -] - -MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', -] - -ROOT_URLCONF = 'daksha.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'daksha.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/3.0/ref/settings/#databases - -#If the user wants to use the database then he must set an Environment Variable named Test_Result_DB as "postgres" -#if the value of this environment variable is not set then the test results will not be saved in the database -TEST_RESULT_DB=os.environ.get('TEST_RESULT_DB',None) - -if (TEST_RESULT_DB !=None and TEST_RESULT_DB.lower() == "postgres"): - DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql', - 'NAME': os.environ.get('PG_DB','postgres'), - 'USER':os.environ.get('PG_USER','postgres'), - 'PASSWORD':os.environ.get('PG_PASSWORD','postgres'), - 'HOST':os.environ.get('PG_HOST','localhost'), - 'PORT':os.environ.get('PG_PORT',5432) - } - } - -#Starting with 3.2 new projects are generated with DEFAULT_AUTO_FIELD set to BigAutoField. -#To avoid unwanted migrations in the future, either explicitly set DEFAULT_AUTO_FIELD to AutoField: -DEFAULT_AUTO_FIELD='django.db.models.AutoField' - -# Password validation -# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators - -AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, -] - - -# Internationalization -# https://docs.djangoproject.com/en/3.0/topics/i18n/ - -LANGUAGE_CODE = 'en-us' - -TIME_ZONE = 'UTC' - -USE_I18N = True - -USE_L10N = True - -USE_TZ = True - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/3.0/howto/static-files/ -STATIC_URL = '/static/' - -#Endpoint which is being hit regulary when cron jobs are executed -daksha_endpoint="http://127.0.0.1:8000/daksha/runner" - -# Set Email to receive test reports -EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER', '') -POSTMARK_TOKEN = os.environ.get('POSTMARK_TOKEN', '') - -# Logs/reports configurations -LOG_FILE = os.environ.get('LOG_FILE', 'logs/uiengine.log') -STORAGE_PATH = os.environ.get('STORAGE_PATH', 'reports') -APACHE_URL = os.environ.get('APACHE_URL', '') - -#Alert configurations -ALERT_URL = os.environ.get('ALERT_URL', '') -# Github Configurations (if you choose to store test ymls in github) - -""" -If either GIT_USER OR GIT_PASSWORD OR both are empty then only Public Repository or Organisation can be accessed -If both GIT_USER and GIT_PASSWORD are given then Public/Private Repository or Organisation can be accessed -Please provide only one field either REPO_ORG or REPO_USER -If you want to use private repo of an Organisation then provide REPO_ORG -If you want to use public repo of individual then provide REPO_USER -""" -GIT_USER = os.environ.get('GIT_USER', '') -GIT_PASS = os.environ.get('GIT_PASS', '') -REPO_NAME = os.environ.get('REPO_NAME', '') -BRANCH_NAME = os.environ.get('BRANCH_NAME', 'main') -REPO_ORG = os.environ.get('REPO_ORG', '') -REPO_USER = os.environ.get('REPO_USER', '') - -REPORT_PORTAL_ENABLED = os.environ.get('REPORT_PORTAL_ENABLED',None) -REPORT_PORTAL_ENDPOINT= os.environ.get('REPORT_PORTAL_ENDPOINT','') -REPORT_PORTAL_PROJECT_NAME= os.environ.get('REPORT_PORTAL_PROJECT_NAME','') -REPORT_PORTAL_TOKEN= os.environ.get('REPORT_PORTAL_TOKEN','') - -report_portal_service=None - -if(REPORT_PORTAL_ENABLED!=None and REPORT_PORTAL_ENABLED.lower()== "true"): - try: - report_portal_service = RPClient(endpoint=REPORT_PORTAL_ENDPOINT, - project=REPORT_PORTAL_PROJECT_NAME, - token=REPORT_PORTAL_TOKEN) - - except Exception as e: - raise Exception("Invalid Credentials") - -CRON_ENABLED=os.environ.get('CRON_ENABLED','false') -CRON_FILE_SOURCE=os.environ.get('CRON_FILE_SOURCE','') -CRON_FILE_PATH=os.environ.get('CRON_FILE_PATH','') -from engine.utils.utils import read_yaml -from engine.logs import * - -if ( CRON_ENABLED != None and CRON_ENABLED.lower()=="true"): - - if(CRON_FILE_SOURCE != None and CRON_FILE_SOURCE.lower()=="local"): - try: - cron_job_descriptor_yml = yaml.safe_load(open(CRON_FILE_PATH)) - except: - logger.info("Cron File Path is given incorrectly") - - elif(CRON_FILE_SOURCE != None and CRON_FILE_SOURCE.lower()=="git"): - try: - cron_store="CRON" - os.makedirs(f"{STORAGE_PATH}/{cron_store}",exist_ok=True) - cron_job_descriptor_yml=read_yaml(REPO_NAME,BRANCH_NAME,CRON_FILE_PATH,cron_store) - except: - logger.info("Cron_File_Path/Repo_Name/Branch_Name given incorrectly ") - - cron_jobs_list = [] - - try: - for cron_job in cron_job_descriptor_yml['crons']: - cron_jobs_list.append((f"{cron_job['cron']}", 'daksha.cron.cron_job_executor',[cron_job['params']],{})) - except: - logger.info("Cron Job is not initialised. Rechek the environment variables and the format of yaml file") - - CRONJOBS=cron_jobs_list - -else: +""" +Daksha +Copyright (C) 2021 myKaarma. +opensource@mykaarma.com +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + +""" +""" +Django settings for daksha project. + +Generated by 'django-admin startproject' using Django 3.0.9. + +For more information on this file, see +https://docs.djangoproject.com/en/3.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/3.0/ref/settings/ +""" + +import os +import yaml +from reportportal_client import RPClient +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', 'gj%7t91&c$*q&+fkx-wuug^i$0b@@lk26vd4txdq=)%_319hyy') + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = False + +ALLOWED_HOSTS = [ + '127.0.0.1' +] +CUSTOM_ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '').split(sep=',') +ALLOWED_HOSTS.extend(CUSTOM_ALLOWED_HOSTS) +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'engine', + 'django_crontab' +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'daksha.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'daksha.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/3.0/ref/settings/#databases + +#If the user wants to use the database then he must set an Environment Variable named Test_Result_DB as "postgres" +#if the value of this environment variable is not set then the test results will not be saved in the database +TEST_RESULT_DB=os.environ.get('TEST_RESULT_DB',None) + +if (TEST_RESULT_DB !=None and TEST_RESULT_DB.lower() == "postgres"): + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql', + 'NAME': os.environ.get('PG_DB','postgres'), + 'USER':os.environ.get('PG_USER','postgres'), + 'PASSWORD':os.environ.get('PG_PASSWORD','postgres'), + 'HOST':os.environ.get('PG_HOST','localhost'), + 'PORT':os.environ.get('PG_PORT',5432) + } + } + +#Starting with 3.2 new projects are generated with DEFAULT_AUTO_FIELD set to BigAutoField. +#To avoid unwanted migrations in the future, either explicitly set DEFAULT_AUTO_FIELD to AutoField: +DEFAULT_AUTO_FIELD='django.db.models.AutoField' + +# Password validation +# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/3.0/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/3.0/howto/static-files/ +STATIC_URL = '/static/' + +#Endpoint which is being hit regulary when cron jobs are executed +daksha_endpoint="http://127.0.0.1:8000/daksha/runner" + +# Set Email to receive test reports +EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER', '') +POSTMARK_TOKEN = os.environ.get('POSTMARK_TOKEN', '') + +# Logs/reports configurations +LOG_FILE = os.environ.get('LOG_FILE', 'logs/uiengine.log') +STORAGE_PATH = os.environ.get('STORAGE_PATH', 'reports') +APACHE_URL = os.environ.get('APACHE_URL', '') + +#Alert configurations +ALERT_URL = os.environ.get('ALERT_URL', '') +# Github Configurations (if you choose to store test ymls in github) + +""" +If either GIT_USER OR GIT_PASSWORD OR both are empty then only Public Repository or Organisation can be accessed +If both GIT_USER and GIT_PASSWORD are given then Public/Private Repository or Organisation can be accessed +Please provide only one field either REPO_ORG or REPO_USER +If you want to use private repo of an Organisation then provide REPO_ORG +If you want to use public repo of individual then provide REPO_USER +""" +GIT_USER = os.environ.get('GIT_USER', '') +GIT_PASS = os.environ.get('GIT_PASS', '') +REPO_NAME = os.environ.get('REPO_NAME', '') +BRANCH_NAME = os.environ.get('BRANCH_NAME', 'main') +REPO_ORG = os.environ.get('REPO_ORG', '') +REPO_USER = os.environ.get('REPO_USER', '') + +REPORT_PORTAL_ENABLED = os.environ.get('REPORT_PORTAL_ENABLED',None) +REPORT_PORTAL_ENDPOINT= os.environ.get('REPORT_PORTAL_ENDPOINT','') +REPORT_PORTAL_PROJECT_NAME= os.environ.get('REPORT_PORTAL_PROJECT_NAME','') +REPORT_PORTAL_TOKEN= os.environ.get('REPORT_PORTAL_TOKEN','') + +report_portal_service=None + +if(REPORT_PORTAL_ENABLED!=None and REPORT_PORTAL_ENABLED.lower()== "true"): + try: + report_portal_service = RPClient(endpoint=REPORT_PORTAL_ENDPOINT, + project=REPORT_PORTAL_PROJECT_NAME, + token=REPORT_PORTAL_TOKEN) + + except Exception as e: + raise Exception("Invalid Credentials") + +CRON_ENABLED=os.environ.get('CRON_ENABLED','false') +CRON_FILE_SOURCE=os.environ.get('CRON_FILE_SOURCE','') +CRON_FILE_PATH=os.environ.get('CRON_FILE_PATH','') +from engine.utils.utils import read_yaml +from engine.logs import * + +if ( CRON_ENABLED != None and CRON_ENABLED.lower()=="true"): + + if(CRON_FILE_SOURCE != None and CRON_FILE_SOURCE.lower()=="local"): + try: + cron_job_descriptor_yml = yaml.safe_load(open(CRON_FILE_PATH)) + except: + logger.info("Cron File Path is given incorrectly") + + elif(CRON_FILE_SOURCE != None and CRON_FILE_SOURCE.lower()=="git"): + try: + cron_store="CRON" + os.makedirs(f"{STORAGE_PATH}/{cron_store}",exist_ok=True) + cron_job_descriptor_yml=read_yaml(REPO_NAME,BRANCH_NAME,CRON_FILE_PATH,cron_store) + except: + logger.info("Cron_File_Path/Repo_Name/Branch_Name given incorrectly ") + + cron_jobs_list = [] + + try: + for cron_job in cron_job_descriptor_yml['crons']: + cron_jobs_list.append((f"{cron_job['cron']}", 'daksha.cron.cron_job_executor',[cron_job['params']],{})) + except: + logger.info("Cron Job is not initialised. Rechek the environment variables and the format of yaml file") + + CRONJOBS=cron_jobs_list + +else: logger.info("Cron jobs not enabled") \ No newline at end of file diff --git a/daksha/urls.py b/daksha/urls.py index dd939a2..ba1f2c7 100644 --- a/daksha/urls.py +++ b/daksha/urls.py @@ -1,43 +1,43 @@ -""" -Daksha -Copyright (C) 2021 myKaarma. -opensource@mykaarma.com -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -""" -"""daksha URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/3.0/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: path('', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.urls import include, path - 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) -""" - -from django.contrib import admin -from django.http import HttpResponse -from django.urls import path, include -from rest_framework import status - - -urlpatterns = [ - path('admin/', admin.site.urls), - path('health', lambda r: HttpResponse('{"status":"up"}', status.HTTP_200_OK)), - path('daksha/', include('engine.urls')), -] +""" +Daksha +Copyright (C) 2021 myKaarma. +opensource@mykaarma.com +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + +""" +"""daksha URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/3.0/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" + +from django.contrib import admin +from django.http import HttpResponse +from django.urls import path, include +from rest_framework import status + + +urlpatterns = [ + path('admin/', admin.site.urls), + path('health', lambda r: HttpResponse('{"status":"up"}', status.HTTP_200_OK)), + path('daksha/', include('engine.urls')), +] diff --git a/daksha/wsgi.py b/daksha/wsgi.py index dc749c3..ef9e9bf 100644 --- a/daksha/wsgi.py +++ b/daksha/wsgi.py @@ -1,32 +1,32 @@ -""" -Daksha -Copyright (C) 2021 myKaarma. -opensource@mykaarma.com -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -""" -""" -WSGI config for daksha project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'daksha.settings') - -application = get_wsgi_application() +""" +Daksha +Copyright (C) 2021 myKaarma. +opensource@mykaarma.com +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + +""" +""" +WSGI config for daksha project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'daksha.settings') + +application = get_wsgi_application() diff --git a/engine/admin.py b/engine/admin.py index 764ef46..3c6387f 100644 --- a/engine/admin.py +++ b/engine/admin.py @@ -1,20 +1,20 @@ -""" -Daksha -Copyright (C) 2021 myKaarma. -opensource@mykaarma.com -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -""" - -from django.contrib import admin - -# Register your models here. +""" +Daksha +Copyright (C) 2021 myKaarma. +opensource@mykaarma.com +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + +""" + +from django.contrib import admin + +# Register your models here. diff --git a/engine/apps.py b/engine/apps.py index f5db7d3..748a808 100644 --- a/engine/apps.py +++ b/engine/apps.py @@ -1,23 +1,23 @@ -""" -Daksha -Copyright (C) 2021 myKaarma. -opensource@mykaarma.com -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -""" - - -from django.apps import AppConfig - - -class EngineConfig(AppConfig): - name = 'engine' +""" +Daksha +Copyright (C) 2021 myKaarma. +opensource@mykaarma.com +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + +""" + + +from django.apps import AppConfig + + +class EngineConfig(AppConfig): + name = 'engine' diff --git a/engine/models.py b/engine/models.py index 9e54513..26f7e89 100644 --- a/engine/models.py +++ b/engine/models.py @@ -1,54 +1,54 @@ -""" -Daksha -Copyright (C) 2021 myKaarma. -opensource@mykaarma.com -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -""" -import copy - -from django.db import models - - -# Create your models here. -class TestExecutor: - def __init__(self, index, test_uuid, variable_dict, test_yml, web_driver , test_result, report_portal_service=None, report_portal_test_id=None): - self.index = index - self.test_uuid = test_uuid - self.variable_dictionary = copy.deepcopy(variable_dict) - self.test_yml = test_yml - self.web_driver = web_driver - self.test_result=test_result - self.report_portal_service=report_portal_service - self.report_portal_test_id=report_portal_test_id - -class TestResult: - def __init__(self, name, test_status, step, failure_reason): - self.test_name = name - self.test_status = test_status - self.failed_step = step - self.failure_cause = failure_reason - -class GetTestResultsResponse: - def __init__(self,testresults,errors): - self.testresults=testresults - self.errors=errors - -class TestResults(models.Model): - TestUUID=models.TextField(max_length=11) - TestName=models.TextField() - Status=models.TextField() - FailureStep=models.TextField() - FailureCause=models.TextField() - InsertTs = models.DateTimeField(auto_now_add=True) #The values updated here are following UTC time zone - UpdateTs = models.DateTimeField(auto_now=True) #The values updated here are following UTC time zone +""" +Daksha +Copyright (C) 2021 myKaarma. +opensource@mykaarma.com +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + +""" +import copy + +from django.db import models + + +# Create your models here. +class TestExecutor: + def __init__(self, index, test_uuid, variable_dict, test_yml, web_driver , test_result, report_portal_service=None, report_portal_test_id=None): + self.index = index + self.test_uuid = test_uuid + self.variable_dictionary = copy.deepcopy(variable_dict) + self.test_yml = test_yml + self.web_driver = web_driver + self.test_result=test_result + self.report_portal_service=report_portal_service + self.report_portal_test_id=report_portal_test_id + +class TestResult: + def __init__(self, name, test_status, step, failure_reason): + self.test_name = name + self.test_status = test_status + self.failed_step = step + self.failure_cause = failure_reason + +class GetTestResultsResponse: + def __init__(self,testresults,errors): + self.testresults=testresults + self.errors=errors + +class TestResults(models.Model): + TestUUID=models.TextField(max_length=11) + TestName=models.TextField() + Status=models.TextField() + FailureStep=models.TextField() + FailureCause=models.TextField() + InsertTs = models.DateTimeField(auto_now_add=True) #The values updated here are following UTC time zone + UpdateTs = models.DateTimeField(auto_now=True) #The values updated here are following UTC time zone VariableDictionary=models.TextField() \ No newline at end of file diff --git a/engine/tests.py b/engine/tests.py index 8bc480b..43d9b1d 100644 --- a/engine/tests.py +++ b/engine/tests.py @@ -1,20 +1,20 @@ -""" -Daksha -Copyright (C) 2021 myKaarma. -opensource@mykaarma.com -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -""" - -from django.test import TestCase - -# Create your tests here. +""" +Daksha +Copyright (C) 2021 myKaarma. +opensource@mykaarma.com +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + +""" + +from django.test import TestCase + +# Create your tests here. diff --git a/engine/urls.py b/engine/urls.py index 91fe51e..c27f429 100644 --- a/engine/urls.py +++ b/engine/urls.py @@ -1,25 +1,25 @@ -""" -Daksha -Copyright (C) 2021 myKaarma. -opensource@mykaarma.com -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -""" - -from django.urls import path - -from . import views - -urlpatterns = [ - path('runner', views.executor, name='singletest'), - path('tests/',views.testresultsretriever) +""" +Daksha +Copyright (C) 2021 myKaarma. +opensource@mykaarma.com +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + +""" + +from django.urls import path + +from . import views + +urlpatterns = [ + path('runner', views.executor, name='singletest'), + path('tests/',views.testresultsretriever) ] \ No newline at end of file diff --git a/manage.py b/manage.py index b370ac8..28f0fae 100644 --- a/manage.py +++ b/manage.py @@ -1,37 +1,37 @@ -#!/usr/bin/env python -""" -Daksha -Copyright (C) 2021 myKaarma. -opensource@mykaarma.com -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -""" -"""Django's command-line utility for administrative tasks.""" -import os -import sys - - -def main(): - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'daksha.settings') - try: - from django.core.management import execute_from_command_line - except ImportError as exc: - raise ImportError( - "Couldn't import Django. Are you sure it's installed and " - "available on your PYTHONPATH environment variable? Did you " - "forget to activate a virtual environment?" - ) from exc - execute_from_command_line(sys.argv) - - -if __name__ == '__main__': - main() +#!/usr/bin/env python +""" +Daksha +Copyright (C) 2021 myKaarma. +opensource@mykaarma.com +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + +""" +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'daksha.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/recorder/extensions/chrome/public/128.png b/recorder/extensions/chrome/public/128.png index ed150cb..6efc3e9 100644 Binary files a/recorder/extensions/chrome/public/128.png and b/recorder/extensions/chrome/public/128.png differ diff --git a/recorder/extensions/chrome/public/favicon.ico b/recorder/extensions/chrome/public/favicon.ico index a11777c..26c8da0 100644 Binary files a/recorder/extensions/chrome/public/favicon.ico and b/recorder/extensions/chrome/public/favicon.ico differ diff --git a/recorder/extensions/chrome/public/manifest.json b/recorder/extensions/chrome/public/manifest.json index 9814dc0..5f55b71 100644 --- a/recorder/extensions/chrome/public/manifest.json +++ b/recorder/extensions/chrome/public/manifest.json @@ -1,7 +1,7 @@ { "name": "Daksha Recorder", "description": "Extension for Daksha", - "version": "2.1.2", + "version": "2.2.1", "manifest_version": 3, "action": { "default_icon":{ @@ -25,9 +25,7 @@ ], "permissions": [ "tabs", - "contextMenus", - "storage", - "scripting" + "storage" ], "content_scripts":[ { diff --git a/recorder/extensions/chrome/src/Icons/BackButton.png b/recorder/extensions/chrome/src/Icons/BackButton.png index ad479e1..07b2a81 100644 Binary files a/recorder/extensions/chrome/src/Icons/BackButton.png and b/recorder/extensions/chrome/src/Icons/BackButton.png differ diff --git a/recorder/extensions/chrome/src/Icons/PauseButton.png b/recorder/extensions/chrome/src/Icons/PauseButton.png index a038a2d..426ff5d 100644 Binary files a/recorder/extensions/chrome/src/Icons/PauseButton.png and b/recorder/extensions/chrome/src/Icons/PauseButton.png differ diff --git a/recorder/extensions/chrome/src/Icons/PlayButton.png b/recorder/extensions/chrome/src/Icons/PlayButton.png index a36f98f..fa7da2a 100644 Binary files a/recorder/extensions/chrome/src/Icons/PlayButton.png and b/recorder/extensions/chrome/src/Icons/PlayButton.png differ diff --git a/recorder/extensions/chrome/src/Icons/RightArrow.png b/recorder/extensions/chrome/src/Icons/RightArrow.png index 66d05f1..a2a7262 100644 Binary files a/recorder/extensions/chrome/src/Icons/RightArrow.png and b/recorder/extensions/chrome/src/Icons/RightArrow.png differ diff --git a/recorder/extensions/chrome/src/Icons/StopButton.png b/recorder/extensions/chrome/src/Icons/StopButton.png index 4acd161..fbcfc6a 100644 Binary files a/recorder/extensions/chrome/src/Icons/StopButton.png and b/recorder/extensions/chrome/src/Icons/StopButton.png differ