Skip to main content

Integrate with Go Test

Testing using Unit Test File

Once you have testcases captured, add this go unit test file main_test.go in the root of your sample application.

  package main

import (

func TestKeploy(t *testing.T) {
go main()

To automatically download and run the captured test-cases. Let's run the test-file.

 go test -coverpkg=./... -covermode=atomic  ./...

output should look like -

ok      test-app-url-shortener  6.268s  coverage: 80.3% of statements in ./...

You'll see the total test-coverage of Keploy recorded test-cases and previously written unit-test cases(if any).

You can use this unit-test file and there's no-need to add any additional steps/checks in your CI pipeline.