Coder Social home page Coder Social logo

mindsdb-status's Introduction

Mindsdb Status

mindsdb-status hosts integration tests to ensure the daily availability and proper functioning of MindsDB Cloud and its various integrations, such as MySQL, PostgreSQL, Snowflake, ClickHouse, and MongoDB. The test results are published on the MindsDB status page: https://mindsdb.instatus.com/

Table of Contents

Getting Started

These instructions will guide you through setting up the project and running the tests on your local machine.

Prerequisites

Installation

Clone the repository:

git clone https://github.com/mindsdb/mindsdb-status.git

Navigate to the project directory:

cd mindsdb-status

Create a virtual environment (recommended):

python -m venv venv

Activate the virtual environment:

  • On Windows:
venv\Scripts\activate
  • On macOS and Linux:
source venv/bin/activate

Install the required dependencies:

pip install -r requirements.txt

Running the Tests

Set the necessary environment variables:

  • On Windows:
set MINDSDB_CLOUD_USER=
set MINDSDB_CLOUD_PASS=
set INSTA_API_KEY=
set INSTA_API_BASE_URL=
  • On macOS and Linux:
export MINDSDB_CLOUD_USER=
export MINDSDB_CLOUD_PASS=
export INSTA_API_KEY=
export INSTA_API_BASE_URL=

Run the tests:

python -m unittest

or to run specific set of tests e.g for connectors:

python -m unittest discover connectors/

License

mindsdb-status is licensed under the MIT License.

mindsdb-status's People

Contributors

mariosajdini avatar minurapunchihewa avatar tcchawla avatar tomhuds avatar vijay-jaisankar avatar zoranpandovski avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mindsdb-status's Issues

Check if incident is opened

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

Create a BaseTest class as an interface for Integration tests

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

New integrations

I think based on the existing tests, we need to add more tests to cover other integrations of MindsDB.

Missing environment variable prevents running tests

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.