CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/golang-github-com-onsi-ginkgo-v2

A mature testing framework for Go designed to help you write expressive specs

Overall
score

97%

Overview
Eval results
Files

task.mdevals/scenario-3/

Test Suite Build Automation

Summary { .summary }

Create a build automation utility that precompiles test suites into standalone binaries for distribution and execution in different environments. The utility should support building test suites with appropriate naming conventions, handle recursive directory traversal, and execute the precompiled binaries with proper configuration.

Dependencies { .dependencies }

github.com/onsi/ginkgo/v2 { .dependency }

A mature testing framework for Go designed to help you write expressive specs.

Requirements { .requirements }

Core Build Functionality { .requirement }

Implement a program that can:

  1. Precompile test suites into standalone executable binaries
  2. Support building test suites from a specified directory path
  3. Use test suite-appropriate naming for the output binaries (following Go test conventions)
  4. Support recursive building of multiple test suites in subdirectories
  5. Handle compilation failures appropriately with error reporting

Binary Execution { .requirement }

The program should be able to:

  1. Execute precompiled test binaries
  2. Pass configuration flags to the test binaries (e.g., verbosity settings)
  3. Return appropriate exit codes based on test execution results

Test Cases { .test-cases }

Test Case 1: Basic Test Suite Build @test { .test-case }

Given a directory containing a Ginkgo test suite, when the build utility is invoked on that directory, it should create a precompiled test binary with an appropriate name (e.g., package.test for a package named "package").

Setup:

  • Create a test suite file calculator/calculator_suite_test.go:
package calculator_test

import (
	"testing"
	. "github.com/onsi/ginkgo/v2"
	. "github.com/onsi/gomega"
)

func TestCalculator(t *testing.T) {
	RegisterFailHandler(Fail)
	RunSpecs(t, "Calculator Suite")
}

var _ = Describe("Calculator", func() {
	It("should add numbers", func() {
		Expect(2 + 2).To(Equal(4))
	})
})

Expected behavior:

  • The utility builds the test suite successfully
  • A binary named calculator.test is created in the calculator directory
  • The binary can be executed and runs the test suite

Test Case 2: Recursive Build @test { .test-case }

Given a directory structure with multiple test suites in subdirectories, when the build utility is invoked with recursive mode, it should build all test suites in the directory tree.

Setup:

  • Create directory structure:
    • math/addition/addition_test.go (test suite for addition)
    • math/subtraction/subtraction_test.go (test suite for subtraction)

Expected behavior:

  • Both test suites are built successfully
  • Binaries are created: math/addition/addition.test and math/subtraction/subtraction.test
  • Each binary can be executed independently

Test Case 3: Test Execution with Configuration @test { .test-case }

When a precompiled test binary is executed, it should accept configuration flags and run accordingly.

Setup:

  • Use a precompiled test binary from Test Case 1

Expected behavior:

  • The binary can be executed with verbosity flags (e.g., -v)
  • Test output is generated showing test results
  • The execution returns exit code 0 for passing tests

Install with Tessl CLI

npx tessl i tessl/golang-github-com-onsi-ginkgo-v2

tile.json