{"id":42088720,"url":"https://github.com/enr/qac","last_synced_at":"2026-01-26T10:35:09.975Z","repository":{"id":57548616,"uuid":"304742479","full_name":"enr/qac","owner":"enr","description":"Go library to test end to end command line tools","archived":false,"fork":false,"pushed_at":"2023-01-03T20:21:16.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-07-27T22:05:14.265Z","etag":null,"topics":["cli","go","go-library","golang","hacktoberfest","testing","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enr.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}},"created_at":"2020-10-16T21:30:06.000Z","updated_at":"2023-03-08T05:06:57.000Z","dependencies_parsed_at":"2023-02-01T09:46:25.838Z","dependency_job_id":null,"html_url":"https://github.com/enr/qac","commit_stats":null,"previous_names":[],"tags_count":3,"template":null,"template_full_name":null,"purl":"pkg:github/enr/qac","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enr%2Fqac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enr%2Fqac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enr%2Fqac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enr%2Fqac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enr","download_url":"https://codeload.github.com/enr/qac/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enr%2Fqac/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28774735,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T09:42:00.929Z","status":"ssl_error","status_checked_at":"2026-01-26T09:42:00.591Z","response_time":59,"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":["cli","go","go-library","golang","hacktoberfest","testing","testing-tools"],"created_at":"2026-01-26T10:35:09.155Z","updated_at":"2026-01-26T10:35:09.971Z","avatar_url":"https://github.com/enr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qac\n\n![CI Linux](https://github.com/enr/qac/workflows/CI%20Nix/badge.svg)\n![CI Windows](https://github.com/enr/qac/workflows/CI%20Windows/badge.svg)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/enr/qac)](https://pkg.go.dev/github.com/enr/qac)\n[![Go Report Card](https://goreportcard.com/badge/github.com/enr/qac)](https://goreportcard.com/report/github.com/enr/qac)\n\n`qac` is a Go library to test _end to end_ command line tools.\n\nA test plan is written in YAML format.\n\n```yaml\npreconditions:\n  fs:\n    - file: ../go.mod\nspecs:\n  cat:\n    command:\n      working_dir: ../\n      cli: cat go.mod\n    expectations:\n      status:\n        equals_to: 0\n      output:\n        stdout:\n          equals_to_file: ../go.mod\n```\n\nUsage in Go tests:\n\n```go\nimport (\n  \"testing\"\n  \"github.com/enr/qac\"\n)\nfunc TestExecution(t *testing.T) {\n  launcher := qac.NewLauncher()\n  report := launcher.ExecuteFile(`/path/to/qac.yaml`)\n  // Not needed but useful to see what's happening\n  reporter := qac.NewTestLogsReporter(t)\n  reporter.Publish(report)\n  // Fail test if any error is found\n  for _, err := range report.AllErrors() {\n    t.Errorf(`error %v`, err)\n  }\n}\n```\n\nProgrammatic usage:\n\n```go\n  // the commmand to test\n  command := qac.Command{\n    Exe: \"echo\",\n    Args: []string{\n      `foo`,\n    },\n  }\n\n  // expectations about its result\n  stdErrEmpty := true\n  expectations := qac.Expectations{\n    StatusAssertion: qac.StatusAssertion{\n      EqualsTo: \"0\",\n    },\n    OutputAssertions: qac.OutputAssertions{\n      Stdout: qac.OutputAssertion{\n        EqualsTo: `foo`,\n      },\n      Stderr: qac.OutputAssertion{\n        IsEmpty: \u0026stdErrEmpty,\n      },\n    },\n  }\n\n  // build the full specs structure\n  spec := qac.Spec{\n    Command:      command,\n    Expectations: expectations,\n  }\n  specs := make(map[string]qac.Spec)\n  specs[`echo`] = spec\n\n  // add specs to test plan\n  plan := qac.TestPlan{\n    Specs: specs,\n  }\n\n  // run the plan\n  launcher := qac.NewLauncher()\n\n  // see results\n  report := launcher.Execute(plan)\n  for _, block := range report.Blocks() {\n    for _, entry := range block.Entries() {\n      fmt.Printf(\" - %s %s %v \\n\", entry.Kind().String(), entry.Description(), entry.Errors())\n    }\n  }\n```\n\n## License\n\nApache 2.0 - see LICENSE file.\n\nCopyright 2020-TODAY qac contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenr%2Fqac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenr%2Fqac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenr%2Fqac/lists"}