https://github.com/katbyte/tctest
CLI utility to run tests on TC for github PRss
https://github.com/katbyte/tctest
Last synced: 8 months ago
JSON representation
CLI utility to run tests on TC for github PRss
- Host: GitHub
- URL: https://github.com/katbyte/tctest
- Owner: katbyte
- License: gpl-3.0
- Created: 2019-05-08T14:32:18.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2025-01-28T15:19:36.000Z (over 1 year ago)
- Last Synced: 2025-04-19T12:13:51.376Z (about 1 year ago)
- Language: Go
- Size: 21.7 MB
- Stars: 16
- Watchers: 2
- Forks: 11
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# tctest


[](https://goreportcard.com/report/github.com/katbyte/tctest)
A command-line utility to trigger builds in teamcity to run provider acceptance tests. Given a PR# it can find the files modified, tests to run and generate a TEST_PATTERN.
Example:

basic help:

## Installation
To install `tctest` from the command line, you can run:
```bash
go install github.com/katbyte/tctest
```
## Configuration
While all commands can be configured from the command line, environment variables can be used instead. By creating a file such as [`set_env_example.sh`](.github/images/set_env_example.sh), it can then be sourced:

## Basic Usage
To run a build on a branch with a test pattern:
```bash
tctest branch master TestAcc -s ci.katbyte.me -b AzureRm -u katbyte
```
or when environment variables are set:
```bash
tctest branch master TestAcc
```
## For a PR
To run a build on the merge branch with a specific test pattern:
```bash
tctest pr 3232 TestAcc -s ci.katbyte.me -b AzureRm -u katbyte -r terraform-providers/terraform-provider-azurerm
```
If no test pattern is specified the modified files in the PR will be checked and it will be generated automatically:
```bash
tctest pr 3232
```
Multiple PRs can be specified at once
```bash
tctest pr 3232,5454,7676
````
To list all the tests discovered for a given PR:
```bash
tctest list 3232
```
To run tests against a PR and display results when complete:
```bash
tctest pr 3232 --wait
```
## Build results:
*By TeamCity Build Number*
To show the PASS/FAIL/SKIP results for a TeamCity build number:
```bash
tctest results 12345
```
To wait for a running or queued build to complete and then show the results:
```bash
tctest results 12345 --wait
```
*By Github PR Number*
To show the PASS/FAIL/SKIP results for **all** TeamCity builds for a Github PR:
```bash
tctest results pr 12345
```
To show the PASS/FAIL/SKIP results for the **latest** TeamCity build for a Github PR:
```bash
tctest results pr 12345 --latest
```
To wait for a running or queued build to complete and then show the results:
```bash
tctest results pr 12345 --wait
```