mindsdb / mindsdb-status Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I think based on the existing tests, we need to add more tests to cover other integrations of MindsDB.
To avoid code repetition across multiple test classes, we can leverage inheritance using a BaseTest class for the setUp and tearDown methods as:
class BaseTest(unittest.TestCase):
def setUp(self):
self.incident = ins()
self.template = template()
self.query_generator = query()
self.logger = setup_logger(__name__)
try:
config = get_value_from_json_env_var('INTEGRATIONS_CONFIG', 'mindsdb_cloud')
self.connection = mysql.connector.connect(**config)
except mysql.connector.Error as err:
cloud_temp = self.template.get_cloud_sql_api_template()
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
self.incident.report_incident("cl8nll9f7106187olof1m17eg17", cloud_temp)
elif err.errno == errorcode.ER_BAD_DB_ERROR:
print("Database does not exist")
else:
self.incident.report_incident("cl8nll9f7106187olof1m17eg17", cloud_temp)
def tearDown(self):
if self.connection.is_connected():
self.connection.close()
etc
Currently we will open new incidents on each run if there are issues with the integrations. We need to check if incident exist, to not open new one
While attempting to run the tests after a fresh install of the dependencies, the following error appears:
OSError: Environment variable INTEGRATIONS_CONFIG is not set.
What is the appropriate value of this environment variable to be set for the tests to run?
Additional information
Here is the full stack trace (symmetric cases for the other integrations):
ERROR: test_execute_query (integrations.test_supabase.MyTestCase)
Create new MySQL Datasource
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/vijay/Desktop/projects/open-source/minds-db/mindsdb-status/integrations/test_supabase.py", line 17, in setUp
self.incident = ins()
File "/home/vijay/Desktop/projects/open-source/minds-db/mindsdb-status/utils/instatus.py", line 16, in __init__
config = get_value_from_json_env_var("INTEGRATIONS_CONFIG", 'instatus')
File "/home/vijay/Desktop/projects/open-source/minds-db/mindsdb-status/utils/config.py", line 54, in get_value_from_json_env_var
raise EnvironmentError(f'Environment variable {env_var_name} is not set.')
OSError: Environment variable INTEGRATIONS_CONFIG is not set.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.