{"id":24639560,"url":"https://github.com/frobware/go-test-sift","last_synced_at":"2025-10-10T20:06:40.584Z","repository":{"id":273555454,"uuid":"920110315","full_name":"frobware/go-test-sift","owner":"frobware","description":"A utility for unscrambling and regrouping interleaved Go test output, making parallel test logs readable again.","archived":false,"fork":false,"pushed_at":"2025-01-22T14:18:00.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T20:06:40.119Z","etag":null,"topics":["go","parallel","test"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frobware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-01-21T15:27:31.000Z","updated_at":"2025-01-22T17:27:36.000Z","dependencies_parsed_at":"2025-01-21T16:44:47.948Z","dependency_job_id":"be849b94-1fd5-4c3c-87ad-320a053e40f9","html_url":"https://github.com/frobware/go-test-sift","commit_stats":null,"previous_names":["frobware/go-test-sift"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/frobware/go-test-sift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Fgo-test-sift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Fgo-test-sift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Fgo-test-sift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Fgo-test-sift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frobware","download_url":"https://codeload.github.com/frobware/go-test-sift/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Fgo-test-sift/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005260,"owners_count":26083860,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["go","parallel","test"],"created_at":"2025-01-25T11:11:54.807Z","updated_at":"2025-10-10T20:06:40.551Z","avatar_url":"https://github.com/frobware.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-test-sift\n\nWhen Go runs unit tests in parallel, their output becomes an interleaved mess, making debugging test failures difficult. `go-test-sift` restores order by regrouping all output for each test and its subtests into a clean, hierarchical structure, preserving the parent-child relationships.\n\n[ YMMV: I have only exercised this tool against the test output from the [cluster-ingress-operator](https://github.com/openshift/cluster-ingress-operator) e2e logs. ]\n\n## Installation\n\n```sh\ngo install github.com/frobware/go-test-sift@latest\n```\n\n## Usage\n\nThe simplest case is to pipe Go test output directly to `go-test-sift`:\n\n```sh\ngo test ./... -v | go-test-sift\n```\n\nThis will regroup all the interleaved parallel test output into a clean, hierarchical format where each test's output is kept together.\n\nYou can also process existing log files or URLs:\n\n```sh\ngo-test-sift test.log\ngo-test-sift https://path/to/test.log\n```\n\n### Additional Options\n\nTo just see test failures:\n```sh\ngo-test-sift -l test.log     # Shows failed test names\ngo-test-sift -L test.log     # Shows failed tests with their output\n```\n\nTo save regrouped output to files:\n```sh\ngo-test-sift -w test.log     # Creates directory structure by test name\n```\n\n### Test Filtering\n\nThe `-t` flag accepts a regular expression to filter which tests to process. It can be used:\n- On its own to filter the default regrouped output\n- Combined with `-l` or `-L` to filter which failures to show\n- Combined with `-w` to filter which test outputs to write to files\n\nExamples:\n```sh\n# Only show output for specific tests\ngo-test-sift -t \"TestAuth.*\" test.log\n\n# Only summarise failures for specific tests\ngo-test-sift -t \"TestAuth.*\" -l test.log\n\n# Only write specific test outputs to files\ngo-test-sift -t \"TestAuth.*\" -w test.log\n```\n\n### Synopsis\n\n```sh\ngo-test-sift [options] \u003cfile|URL\u003e\n  -F\tForce directory creation even if directories exist\n  -L\tPrint summary of failures and include the full output for each failure\n  -d\tEnable debug output\n  -l\tPrint summary of failures (list test names with failures)\n  -o string\n        Base directory to write output files (default current directory) (default \".\")\n  -t string\n        Regular expression to filter test names for summary output (default \".*\")\n  -w\tWrite each test's output to individual files\n```\n\n## Real-world usage:\n\n```sh\ngo-test-sift -L https://storage.googleapis.com/test-platform-results/pr-logs/pull/openshift_cluster-ingress-operator/1182/pull-ci-openshift-cluster-ingress-operator-master-e2e-aws-operator-techpreview/1881996429715574784/build-log.txt\n--- FAIL: TestAll (3300.90s)\n    --- FAIL: TestAll/parallel (98.74s)\n        --- FAIL: TestAll/parallel/Test_IdleConnectionTerminationPolicyDeferred (195.13s)\n                idle_connection_test.go:598: Creating namespace \"idle-connection-close-deferred-t2mgq\"...\n                idle_connection_test.go:598: Waiting for ServiceAccount idle-connection-close-deferred-t2mgq/default to be provisioned...\n                idle_connection_test.go:598: Waiting for RoleBinding idle-connection-close-deferred-t2mgq/system:image-pullers to be created...\n                idle_connection_test.go:598: Creating IngressController openshift-ingress-operator/idle-connection-close-deferred-t2mgq...\n                \u003csnip\u003e\n                util_test.go:941: 2025-01-22 10:36:27 +0000 UTC {kubelet ip-10-0-124-179.us-east-2.compute.internal} Pod web-service-1 Started Started container web-service-1\n                util_test.go:941: 0001-01-01 00:00:00 +0000 UTC { } Pod web-service-2 Scheduled Successfully assigned idle-connection-close-deferred-t2mgq/web-service-2 to ip-10-0-94-112.us-east-2.compute.internal\n                util_test.go:941: 2025-01-22 10:36:33 +0000 UTC {multus } Pod web-service-2 AddedInterface Add eth0 [10.129.2.30/23] from ovn-kubernetes\n                util_test.go:941: 2025-01-22 10:36:33 +0000 UTC {kubelet ip-10-0-94-112.us-east-2.compute.internal} Pod web-service-2 Pulled Container image \"registry.build06.ci.openshift.org/ci-op-q14lpbwi/stable@sha256:e1fa3c38a5cea8a45d127aecd900299ede0c5988495dc6c5db0c1875e4ab4995\" already present on machine\n                util_test.go:941: 2025-01-22 10:36:33 +0000 UTC {kubelet ip-10-0-94-112.us-east-2.compute.internal} Pod web-service-2 Created Created container web-service-2\n                util_test.go:941: 2025-01-22 10:36:33 +0000 UTC {kubelet ip-10-0-94-112.us-east-2.compute.internal} Pod web-service-2 Started Started container web-service-2\n                util_test.go:943: Deleting namespace \"idle-connection-close-deferred-t2mgq\"...\n```\n\n```sh\ngo-test-sift -t Test_IdleConnectionTerminationPolicy https://storage.googleapis.com/test-platform-results/pr-logs/pull/openshift_cluster-ingress-operator/1182/pull-ci-openshift-cluster-ingress-operator-master-e2e-aws-operator-techpreview/1881996429715574784/build-log.txt\n        --- PASS: TestAll/parallel/Test_IdleConnectionTerminationPolicyImmediate (162.97s)\n                idle_connection_test.go:545: Creating namespace \"idle-connection-close-immediate-f5ms9\"...\n                idle_connection_test.go:545: Waiting for ServiceAccount idle-connection-close-immediate-f5ms9/default to be provisioned...\n                idle_connection_test.go:545: Waiting for RoleBinding idle-connection-close-immediate-f5ms9/system:image-pullers to be created...\n                idle_connection_test.go:545: Creating IngressController openshift-ingress-operator/idle-connection-close-immediate-f5ms9...\n                util_test.go:694: waiting for loadbalancer domain a4420035d95134ad48d26e05284f6ece-18856627.us-east-2.elb.amazonaws.com to resolve...\n                util_test.go:694: waiting for loadbalancer domain a4420035d95134ad48d26e05284f6ece-18856627.us-east-2.elb.amazonaws.com to resolve...\n                \u003csnip\u003e\n                idle_connection_test.go:545: step 3: Ensure subsequent responses are served by web-service-2\n                idle_connection_test.go:566: [10.131.224.239:34016 -\u003e 3.22.28.49:80] Req: URL=http://3.22.28.49, Host=test-idle-connection-close-immediate-f5ms9.apps.ci-op-q14lpbwi-9e7c5.origin-ci-int-aws.dev.rhcloud.com\n                idle_connection_test.go:566: [10.131.224.239:34016 \u003c- 3.22.28.49:80] Res: Status=200, Headers=map[Content-Length:[8] Content-Type:[text/plain; charset=utf-8] Date:[Wed, 22 Jan 2025 10:37:07 GMT] Set-Cookie:[6d90e534fc735aa6806d7332b8f3e32b=e5ca86e727e8ef81afc42bbcdaa1a897; path=/; HttpOnly] X-Pod-Name:[web-service-2] X-Pod-Namespace:[unknown-namespace]]\n                idle_connection_test.go:397: deleted ingresscontroller idle-connection-close-immediate-f5ms9\n                util_test.go:939: Dumping events in namespace \"idle-connection-close-immediate-f5ms9\"...\n                util_test.go:943: Deleting namespace \"idle-connection-close-immediate-f5ms9\"...\n        --- FAIL: TestAll/parallel/Test_IdleConnectionTerminationPolicyDeferred (195.13s)\n                idle_connection_test.go:598: Creating namespace \"idle-connection-close-deferred-t2mgq\"...\n                idle_connection_test.go:598: Waiting for ServiceAccount idle-connection-close-deferred-t2mgq/default to be provisioned...\n                idle_connection_test.go:598: Waiting for RoleBinding idle-connection-close-deferred-t2mgq/system:image-pullers to be created...\n                idle_connection_test.go:598: Creating IngressController openshift-ingress-operator/idle-connection-close-deferred-t2mgq...\n                util_test.go:694: waiting for loadbalancer domain a9eeec12dfe994550aa9fd1687e66b65-1711296474.us-east-2.elb.amazonaws.com to resolve...\n                util_test.go:694: waiting for loadbalancer domain a9eeec12dfe994550aa9fd1687e66b65-1711296474.us-east-2.elb.amazonaws.com to resolve...\n                \u003csnip\u003e\n                idle_connection_test.go:598: step 1: Verify the initial response is correctly served by web-service-1\n                idle_connection_test.go:602: [10.131.224.239:43382 -\u003e 3.128.128.128:80] Req: URL=http://3.128.128.128, Host=test-idle-connection-close-deferred-t2mgq.apps.ci-op-q14lpbwi-9e7c5.origin-ci-int-aws.dev.rhcloud.com\n                idle_connection_test.go:602: [10.131.224.239:43382 \u003c- 3.128.128.128:80] Res: Status=200, Headers=map[Content-Length:[8] Content-Type:[text/plain; charset=utf-8] Date:[Wed, 22 Jan 2025 10:36:56 GMT] Set-Cookie:[357f8d00002ad5a815d58dad294244fc=a63bc34bc547085dc2dbe253c0550c80; path=/; HttpOnly] X-Pod-Name:[web-service-1] X-Pod-Namespace:[unknown-namespace]]\n                idle_connection_test.go:598: step 2: Switch route to web-service-2 and validate Deferred policy allows one final response to be served by web-service-1\n                idle_connection_test.go:612: [10.131.224.239:43382 -\u003e 3.128.128.128:80] Req: URL=http://3.128.128.128, Host=test-idle-connection-close-deferred-t2mgq.apps.ci-op-q14lpbwi-9e7c5.origin-ci-int-aws.dev.rhcloud.com\n                idle_connection_test.go:612: [10.131.224.239:43382 \u003c- 3.128.128.128:80] Res: Status=503, Headers=map[Cache-Control:[private, max-age=0, no-cache, no-store] Content-Type:[text/html] Pragma:[no-cache]]\n                idle_connection_test.go:598: step 2: unexpected response: got \"\", want \"web-service-1\"\n                idle_connection_test.go:397: deleted ingresscontroller idle-connection-close-deferred-t2mgq\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrobware%2Fgo-test-sift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrobware%2Fgo-test-sift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrobware%2Fgo-test-sift/lists"}