{"id":28916960,"url":"https://github.com/valkey-io/valkey-test-framework","last_synced_at":"2025-08-25T00:41:43.158Z","repository":{"id":285001535,"uuid":"955630435","full_name":"valkey-io/valkey-test-framework","owner":"valkey-io","description":"A python based test framework of the Valkey engine","archived":false,"fork":false,"pushed_at":"2025-03-28T20:23:00.000Z","size":32,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"unstable","last_synced_at":"2025-03-28T21:26:59.019Z","etag":null,"topics":["python","testing-framework","valkey"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/valkey-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-27T00:13:32.000Z","updated_at":"2025-03-28T20:27:18.000Z","dependencies_parsed_at":"2025-03-28T21:37:24.673Z","dependency_job_id":null,"html_url":"https://github.com/valkey-io/valkey-test-framework","commit_stats":null,"previous_names":["valkey-io/valkey-test-framework"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/valkey-io/valkey-test-framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valkey-io%2Fvalkey-test-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valkey-io%2Fvalkey-test-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valkey-io%2Fvalkey-test-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valkey-io%2Fvalkey-test-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valkey-io","download_url":"https://codeload.github.com/valkey-io/valkey-test-framework/tar.gz/refs/heads/unstable","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valkey-io%2Fvalkey-test-framework/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261212527,"owners_count":23125590,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","testing-framework","valkey"],"created_at":"2025-06-22T00:10:48.423Z","updated_at":"2025-08-12T12:37:53.369Z","avatar_url":"https://github.com/valkey-io.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# valkey-test-framework\nValkey-test-framework is a python framework for creating integration tests using Valkey. With this, users developing software around Valkey (e.g Modules, extensions to Valkey, or even core Valkey itself) can easily set up python integration tests to validate functionality. The framework is designed to be simple and flexible.\n\nIt allows various functionalities including: Starting up custom Valkey Servers per TestClass or per individual Test, Customizing server startup arguments (e.g. module load, configs), custom server binary path, Replication Testing, Waiter functionality, etc.\n\nIt uses pytest for identifying test files (and running the individual test classes containing all the tests). The framework is compatible with pytest versions up till 7.4.3.\n\n## Build instructions\n\n```\ngit clone https://github.com/valkey-io/valkey-test-framework.git\ncd valkey-test-framework\n./build.sh\n```\n\n## Usage\n\n**Using a customized Valkey Server per Individual Test**\n\nIf you want to have a specific start up for certain tests, first inherit ValkeyTestCase in your test class, and then customize the server creation per individual test. \n```\nclass TestExamplePerTestSetup(ValkeyTestCase):\n    def test_basic1(self):\n        server_path = \"/path_to_your_valkey_server_binary\"\n        additional_startup_args = {\"config1_name\":\"config_value1\", \"config2_name\":\"config_value2\"}\n        self.server, self.client = self.create_server(\n            testdir=self.testdir, server_path=server_path, args=additional_startup_args\n        )\n        self.client.execute_command(\"PING\")\n\n    def test_basic2(self):\n        server_path = \"/path_to_your_valkey_server_binary\"\n        # Example of no startup args\n        additional_startup_args = \"\"\n        self.server, self.client = self.create_server(\n            testdir=self.testdir, server_path=server_path, args=additional_startup_args\n        )\n        self.client.execute_command(\"SET K V\")\n```\n\n**Using a customized Valkey Server per Test Class**\n\nIf you want all tests to have the same startup arguments, we have made this simple by reducing the number of times that you need to specify arguments or version. Have a Base Class that does a common server setup and have every Test Class inherit the common Base Class:\n\n```\nclass ExampleTestCaseBase(ValkeyTestCase):\n    @pytest.fixture(autouse=True)\n    def setup_test(self, setup):\n        server_path = \"/path_to_your_valkey_server_binary\"\n        # Example of no startup args\n        additional_startup_args = \"\"\n        self.server, self.client = self.create_server(\n            testdir=self.testdir, server_path=server_path, args=additional_startup_args\n        )\n\nclass TestExamplePerClassSetup(ExampleTestCaseBase):\n    \"\"\"\n    Every test will use the same server startup from the ExampleTestCaseBase.\n    \"\"\"\n\n    def test_basic1(self):\n        client = self.server.get_new_client()\n        client.execute_command(\"PING\")\n\n    def test_basic2(self):\n        client = self.server.get_new_client()\n        client.execute_command(\"SET K V\")\n```\n\nFor more examples, refer to the `tests` directory of this package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalkey-io%2Fvalkey-test-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalkey-io%2Fvalkey-test-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalkey-io%2Fvalkey-test-framework/lists"}