Vibranium Config file

The Vibranium config file is the most important part of the Vibranium setup. This file specifies important details like system credentials, default account, tests directory name, global variables, logger and executor properties None of the tests can run if the config file is not found or if there's an error in the config.

Important keys

  • tests_directory: The name of the directory inside the workspace, where all tests are stored, This is the directory in the workspace directory inside which you'll find the scenarios, payloads, schemas etc. Usually, it is named tests or Vibranium-Tests
  • accounts: The different system/account/app details. You can define as many systems as needed as key-object pairs. The key specifies the system name and the value object specifies the system details. Supported authentication methods are basic auth, client-credentials and no-auth.
  • default_account: The account from the list of accounts that needs to be used as the default system for all executions unless specified. If any APi uses the system keyword, it picks the system from this list.
  • env_vars: The global variables that can be used throughout all executions. Refer to Variables for more details
  • executors.max_parallel_executors: The default limit for the number of parallel executors. The bigger the number, the more parallel executors Vibranium spawns. But as with most cases, the effects will reduce after a certain number. It is usually recommended to keep this value based on the number of cores and threads in your system CPU. For example, for a hexacore CPU with two threads each, it is recommended to use 12.

The Config file Schema

{
    "$schema": "http://json-schema.org/draft-06/schema#",
    "type": "object",
    "title": "The user configuration object",
    "description": "The user configuration contains all the system details, the default system and other configuration for Vibranium",
    "properties": {
        "accounts": {
            "$id": "#/properties/accounts",
            "type": "object",
            "title": "The Accounts Schema",
            "description": "List of all systems/account details",
            "default": {},
            "examples": [
                {
                    "system_that_uses_no_auth": {
                        "api_url": "API_ENDPOINT",
                        "method": "none",
                        "url": "SYSTEM_UI_URL"
                    },
                    "another_system_that_uses_jwt_token_based_auth": {
                        "url": "SYSTEM_UI_URL",
                        "oauth_url": "OAUTH_TOKEN_URL_FOR_THE_SYSTEM",
                        "api_url": "API_ENDPOINT",
                        "method": "oauth2",
                        "credentials": {
                            "clientid": "MY_SUPER_SECRET_CLIENT_ID",
                            "secret": "MY_SUPER_SECRET_CLIENT_SECRET"
                        }
                    },
                    "some_random_name_for_my_system_with_basic_auth": {
                        "api_url": "API_ENDPOINT",
                        "credentials": {
                            "password": "MY_SUPER_SECRET_PASSWORD",
                            "username": "MY_SUPER_SECRET_USERNAME",
                            "additionalProperty": "something"
                        },
                        "url": "SYSTEM_UI_URL",
                        "additionalProperty": "test",
                        "variables": {}
                    }
                }
            ],
            "patternProperties": {
                "^.*$": {
                    "$id": "#/properties/accounts/properties/.*$",
                    "type": "object",
                    "title": "System details",
                    "description": "System Details",
                    "default": {},
                    "examples": [
                        {
                            "api_url": "API_ENDPOINT",
                            "method": "none",
                            "url": "SYSTEM_UI_URL"
                        },
                        {
                            "api_url": "API_ENDPOINT",
                            "method": "basic",
                            "credentials": {
                                "password": "MY_SUPER_SECRET_PASSWORD",
                                "username": "MY_SUPER_SECRET_USERNAME"
                            },
                            "url": "SYSTEM_UI_URL"
                        },
                        {
                            "api_url": "API_ENDPOINT",
                            "method": "oauth2",
                            "credentials": {
                                "clientid": "MY_SUPER_SECRET_CLIENT_ID",
                                "secret": "MY_SUPER_SECRET_CLIENT_SECRET"
                            },
                            "url": "SYSTEM_UI_URL",
                            "oauth_url": "OAUTH_TOKEN_URL_FOR_THE_SYSTEM"
                        }
                    ],
                    "properties": {
                        "url": {
                            "$id": "#/properties/accounts/properties/.*/properties/url",
                            "type": "string",
                            "title": "The Url Schema",
                            "description": "System url",
                            "default": "",
                            "examples": [
                                "https://www.github.com"
                            ]
                        },
                        "api_url": {
                            "$id": "#/properties/accounts/properties/.*/properties/api_url",
                            "type": "string",
                            "title": "The api url",
                            "description": "API url",
                            "default": "",
                            "examples": [
                                "https://www.github.com/api/v3"
                            ]
                        },
                        "method": {
                            "$id": "#/properties/accounts/properties/.*/properties/method",
                            "type": "string",
                            "title": "Authentication method",
                            "description": "Type of authentication to use",
                            "default": "oauth2",
                            "examples": [
                                "none",
                                "basic",
                                "basic-authentication",
                                "username-password",
                                "oauth2",
                                "client-credentials",
                                "jwt",
                                "cf-jwt",
                                "jwt-token"
                            ]
                        },
                        "oauth_url": {
                            "$id": "#/properties/accounts/properties/.*/properties/oauth_url",
                            "type": "string",
                            "title": "Oauth Url",
                            "description": "To be filled if method is one of 'oauth2','client-credentials','jwt','cf-jwt','jwt-token'",
                            "default": "",
                            "examples": [
                                "https://www.github.com/api/v3/oauth/token"
                            ]
                        },
                        "variables": {
                            "$id": "#/properties/accounts/properties/.*/properties/variables",
                            "type": "object",
                            "title": "Variables for this system specific",
                            "description": "Account specific variables",
                            "default": {},
                            "examples": [
                                {
                                    "systemName": "DEV_1"
                                }
                            ]
                        },
                        "additionalProperties": {
                            "$id": "#/properties/accounts/properties/.*/properties/additionalProperties",
                            "type": [
                                "string",
                                "object"
                            ],
                            "title": "Any additional property",
                            "description": "Any additional property",
                            "default": "",
                            "examples": [
                                "test"
                            ]
                        },
                        "credentials": {
                            "$id": "#/properties/accounts/properties/.*/properties/credentials",
                            "type": "object",
                            "title": "Credentials for the system",
                            "description": "Syetm credentials",
                            "default": {},
                            "examples": [
                                {
                                    "password": "MY_SUPER_SECRET_PASSWORD",
                                    "username": "MY_SUPER_SECRET_USERNAME"
                                },
                                {
                                    "clientid": "MY_SUPER_SECRET_CLIENT_ID",
                                    "secret": "MY_SUPER_SECRET_CLIENT_SECRET"
                                }
                            ],
                            "properties": {
                                "clientid": {
                                    "$id": "#/properties/accounts/properties/.*/properties/credentials/properties/clientid",
                                    "type": "string",
                                    "title": "System client ID for client credentials flow",
                                    "description": "To be filled if method is one of 'oauth2','client-credentials','jwt','cf-jwt','jwt-token'",
                                    "default": "",
                                    "examples": [
                                        "MY_SUPER_SECRET_CLIENT_ID"
                                    ]
                                },
                                "secret": {
                                    "$id": "#/properties/accounts/properties/.*/properties/credentials/properties/secret",
                                    "type": "string",
                                    "title": "System client secret for client credentials flow",
                                    "description": "To be filled if method is one of 'oauth2','client-credentials','jwt','cf-jwt','jwt-token'",
                                    "default": "",
                                    "examples": [
                                        "MY_SUPER_SECRET_CLIENT_SECRET"
                                    ]
                                },
                                "username": {
                                    "$id": "#/properties/accounts/properties/.*/properties/credentials/properties/username",
                                    "type": "string",
                                    "title": "Username for basic auth",
                                    "description": "To be filled if method is one of 'basic','basic-authentication','username-password'",
                                    "default": "",
                                    "examples": [
                                        "MY_SUPER_SECRET_USERNAME"
                                    ]
                                },
                                "password": {
                                    "$id": "#/properties/accounts/properties/.*/properties/credentials/properties/password",
                                    "type": "string",
                                    "title": "Password for basic auth",
                                    "description": "To be filled if method is one of 'basic','basic-authentication','username-password'",
                                    "default": "",
                                    "examples": [
                                        "MY_SUPER_SECRET_PASSWORD"
                                    ]
                                },
                                "additionalProperties": {
                                    "$id": "#/properties/accounts/properties/.*/properties/credentials/properties/additionalProperties",
                                    "anyOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "object"
                                        }
                                    ],
                                    "title": "Any additional property",
                                    "description": "Any additional property",
                                    "default": "",
                                    "examples": [
                                        "test"
                                    ]
                                }
                            },
                            "additionalProperties": false
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "api_url"
                    ]
                }
            },
            "additionalProperties": false
        },
        "default_account": {
            "$id": "#/properties/default_account",
            "type": "string",
            "title": "The default account name",
            "description": "The account name to be used for all executions. Has to be one of the keys in the accounnts object mentioned before.",
            "default": "",
            "examples": [
                "system_that_uses_no_auth"
            ]
        },
        "tests_directory": {
            "$id": "#/properties/tests_directory",
            "type": "string",
            "title": "The tests directory name",
            "description": "The directory name inside the workspace, where all scenarios, payloads etc are available",
            "default": "Vibranium-Tests",
            "examples": [
                "Vibranium-Tests",
                "tests",
                "vib"
            ]
        },
        "env_vars": {
            "$id": "#/properties/env_vars",
            "type": "object",
            "title": "Environment/Global variables",
            "description": "Pre defined global variables, applicable to all executions",
            "default": {},
            "examples": [
                {
                    "short_text": "[a-zA-Z 0-9]{5, 20}",
                    "lorem_255": "{lorem_255}",
                    "lorem_5000": "{lorem_5000}"
                }
            ],
            "patternProperties": {
                "^.*$": {
                    "$id": "#/properties/env_vars/properties/.*",
                    "type": "string",
                    "title": "The variable definition",
                    "description": "The key is the variable name and the value is the global variable's value",
                    "default": "",
                    "examples": [
                        "[a-zA-Z 0-9]{5, 20}",
                        "{lorem_255}",
                        "{lorem_5000}",
                        "{jobId}.{time_ms}",
                        "test_{date_date}_{timestamp}"
                    ]
                }
            },
            "additionalProperties": false
        },
        "executor": {
            "$id": "#/properties/executor",
            "type": "object",
            "title": "Executor configuration",
            "description": "Test executor configuration",
            "default": {},
            "examples": [
                {
                    "max_parallel_executors": 5
                }
            ],
            "required": [
                "max_parallel_executors"
            ],
            "properties": {
                "max_parallel_executors": {
                    "$id": "#/properties/executor/properties/max_parallel_executors",
                    "type": "integer",
                    "title": "Maximum parallel threads",
                    "description": "Number of parallel executors",
                    "default": 5,
                    "examples": [
                        20
                    ]
                }
            }
        },
        "logger": {
            "$id": "#/properties/logger",
            "type": "object",
            "title": "Logger configuration",
            "description": "Logger configuration",
            "default": {},
            "examples": [
                {
                    "default_log_level": "INFO",
                    "max_log_history_to_keep": "30d"
                }
            ],
            "required": [
                "default_log_level",
                "max_log_history_to_keep"
            ],
            "properties": {
                "default_log_level": {
                    "$id": "#/properties/logger/properties/default_log_level",
                    "type": "string",
                    "title": "Default log level",
                    "description": "Default log level",
                    "default": "INFO",
                    "examples": [
                        "INFO",
                        "DEBUG",
                        "ERROR"
                    ]
                },
                "max_log_history_to_keep": {
                    "$id": "#/properties/logger/properties/max_log_history_to_keep",
                    "type": "string",
                    "title": "Log rotation",
                    "description": "Max time period to keep logs",
                    "default": "30d",
                    "examples": [
                        "30d",
                        "3d",
                        "1m"
                    ]
                },
                "max_job_history_to_keep": {
                    "$id": "#/properties/logger/properties/max_job_history_to_keep",
                    "type": "string",
                    "title": "Log rotation",
                    "description": "Max number of job history to keep",
                    "default": "30",
                    "examples": [
                        "all",
                        "10",
                        "100"
                    ]
                }
            }
        }
    },
    "additionalProperties": false,
    "required": [
        "accounts",
        "default_account",
        "tests_directory",
        "env_vars",
        "executor",
        "logger"
    ]
}

« Previous Next »