{"id":37072400,"url":"https://github.com/denizariyan/gflake","last_synced_at":"2026-01-14T08:30:00.891Z","repository":{"id":307980406,"uuid":"1030895229","full_name":"denizariyan/gflake","owner":"denizariyan","description":"A CLI tool to automatically discover and repeatedly run Google Test (gtest) test cases to identify flaky tests.","archived":false,"fork":false,"pushed_at":"2025-09-08T08:07:01.000Z","size":120,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-28T02:22:30.058Z","etag":null,"topics":["cpp","flaky-tests","google-test","gtest","python","testing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/denizariyan.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-02T15:02:53.000Z","updated_at":"2025-09-17T08:06:00.000Z","dependencies_parsed_at":"2025-08-03T13:04:57.051Z","dependency_job_id":"38a304c7-27af-4db7-992f-1db7294f64cc","html_url":"https://github.com/denizariyan/gflake","commit_stats":null,"previous_names":["denizariyan/gflake"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/denizariyan/gflake","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denizariyan%2Fgflake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denizariyan%2Fgflake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denizariyan%2Fgflake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denizariyan%2Fgflake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denizariyan","download_url":"https://codeload.github.com/denizariyan/gflake/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denizariyan%2Fgflake/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:16:59.381Z","status":"ssl_error","status_checked_at":"2026-01-14T08:13:45.490Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cpp","flaky-tests","google-test","gtest","python","testing"],"created_at":"2026-01-14T08:30:00.344Z","updated_at":"2026-01-14T08:30:00.883Z","avatar_url":"https://github.com/denizariyan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gFlake - Google Test Deflaking Tool\n\nA CLI tool to automatically discover and repeatedly run Google Test (gtest) test cases to identify flaky tests.\n\n## Features\n\n- **Automatic Test Discovery** - Discovers all gtest test cases from your binary\n- **Interactive Menus** - Hierarchical menus for test selection\n- **Multiprocess Execution** - Parallel test execution for maximum throughput\n- **Real-time Progress** - Live progress bars and statistics\n- **Timing Analysis** - Statistical analysis of test execution times\n- **Failure Logging** - All failed runs logged to `failed_tests.log`\n\n![gflake Demo](static/gflake.gif)\n\n## Quick Start\n\n### 1. Installation\n\n#### From PyPI\n\n##### Using pipx (recommended):\n\nInstall pipx if you haven't already by following [the instructions](https://pipx.pypa.io/stable/installation/).\n\n```bash\npipx install gflake\n```\n\n##### Using pip:\n\nIf installing pipx is not an option, you may also install gflake using pip:\n\n```bash\npip install --user gflake\n```\n\nEnsure that your `PATH` includes the directory where pip installs executables (usually `~/.local/bin` on Linux/macOS).\n\n#### From Source\n\nInstall Git LFS for large files by following [the instructions](https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage).\n\nThen, clone the repository and install dependencies using Poetry:\n\n```bash\n# Clone the repository\ngit clone git@github.com:denizariyan/gflake.git\ncd gflake\n\n# Install with Poetry\npoetry install\n\n# Alternatively, use make alias\nmake install\n```\n\n## Usage\n\n### Interactive Mode (Recommended)\n\n```bash\ngflake run \u003cpath-to-your-gtest-binary\u003e\n```\n\nThis will:\n\n1. Discover all tests in your binary\n2. Show interactive menus to select test suites and cases\n3. Execute the test repeatedly with progress bars\n4. Show detailed statistics and failure analysis\n\n### Command Options\n\n```bash\ngflake run \u003cbinary\u003e [OPTIONS]\n\nOptions:\n  -t, --test-name TEXT     Full test name (e.g., 'SuiteName.TestCase') to run directly without menu\n  -d, --duration FLOAT     Duration to run tests in seconds [default: 5.0]\n  -p, --processes INT      Number of parallel processes [default: half of CPU cores]\n  -v, --verbose            Enable verbose output\n  --help                   Show help message\n```\n\n### Examples\n\n```bash\n# Interactive mode - shows menus for test selection\ngflake run \u003cpath-to-your-gtest-binary\u003e --duration 30\n\n# Direct test execution - runs specific test without menu\ngflake run \u003cpath-to-your-gtest-binary\u003e --test-name \"BasicTests.FlakyTest\" --duration 30\n\n# Run for 10 minutes with 4 processes\ngflake run \u003cpath-to-your-gtest-binary\u003e --duration 600 --processes 4\n\n# Run without parallelisation\ngflake run \u003cpath-to-your-gtest-binary\u003e --processes 1\n```\n\n### Test Discovery\n\n```bash\n# List all available tests without running them\ngflake discover \u003cpath-to-your-gtest-binary\u003e\n```\n\n#### Finding Test Names for Direct Execution\n\nUse the `discover` command to see all available test names in the exact format needed for the `--test-name` option:\n\nExample output:\n\n```bash\ngflake discover cpp/build/test_binary\n\n📁 BasicTests (3 tests)\n├── 🧩 SimpleTest                   # Use: BasicTests.SimpleTest\n└── 🧩 SlowTest                     # Use: BasicTests.SlowTest\n\n📁 TypedTest/0 (2 tests) (typed)\n├── 🧩 DefaultConstruction          # Use: TypedTest/0.DefaultConstruction\n└── 🧩 Assignment                   # Use: TypedTest/0.Assignment\n```\n\n## Understanding the Output\n\n### Session Summary\n\ngFlake provides a comprehensive session summary table with the following metrics:\n\n- **Test Case**: Full name of the test that was executed\n- **Progress**: Real-time progress showing elapsed time vs target duration\n- **Time Remaining**: Time left in the session\n- **Processes Used**: Number of parallel processes utilized during execution\n\n- **Total Attempts**: Total number of test runs executed during the session\n- **Successful Runs**: Number of runs that passed successfully\n- **Failed Runs**: Number of runs that failed\n- **Success Rate**: Percentage of successful runs\n- **Throughput**: Tests executed per second across all processes\n\n- **Median/Mean/Min/Max Time**: Aggregated statistics for all test runs\n\n### Failure Analysis\n\n- First few failures shown with full output\n- All failures logged to `failed_tests.log` with timestamps\n\n## Log Files\n\nFailed test runs are automatically logged to `failed_tests.log`:\n\n```\n================================================================================\ngFlake Session: 2025-07-31 21:17:44\nTotal Failed Runs: 3157\n================================================================================\n\nFAILURE #1\n————————————————————————————————————————\nReturn Code: 1\nDuration: 3.7ms\n\nStandard Output:\nRunning main() from /path/to/gtest_main.cc\n/path/to/test.cpp:41: Failure\nFailed\nSimulated flaky test failure (random value: 1)\n\n[  FAILED  ] BasicTests.FlakyTest (0 ms)\n...\n```\n\n## Development\n\n```bash\n# Install dependencies\npoetry install\n\n# Build sample C++ binary with gtest\nmkdir -p cpp/build \u0026\u0026 cd cpp/build \u0026\u0026 cmake .. \u0026\u0026 cmake --build .\n\n# Run Python tests\n## Using Poetry\npoetry run pytest tests/\n## Using Makefile alias\nmake test-python\n\n# Run C++ tests\n## Using CMake\ncd cpp/build \u0026\u0026 ctest\n## Using Makefile alias\nmake test-cpp        # Without flaky test\nmake test-cpp-all    # With flaky test\n\n# Use sample gtest binary\n## Run using installed gflake\ngflake run cpp/build/test_binary\n\n## Run via poetry\npoetry run gflake run cpp/build/test_binary\n\n# Run linter\nmake lint-fix\n\n# Run formatter\nmake format\n```\n\n## Tips\n\n- **Start Small**: Begin with short durations (30-60 seconds) to verify your setup\n- **Adjust Processes**: Use `--processes` to match your system capabilities if the defaults (half of available cores) are not optimal.\n  - If your tests share resources (e.g. database operations) or affect each other in any way, consider running with `--processes 1` to avoid interference.\n- **Monitor Logs**: Check `failed_tests.log` for detailed failure analysis\n- **Use Discovery**: Run `gflake discover` to see all available tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenizariyan%2Fgflake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenizariyan%2Fgflake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenizariyan%2Fgflake/lists"}