# Go Integration Testing

> Tests de integración en Go. Usar al testear múltiples componentes juntos o validar flujos end-to-end.

- Skill: `tomevault-io/go-integration-testing` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/go-integration-testing`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/go-integration-testing/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/go-integration-testing

---


# Skill: go-integration-testing

Tests de integración en Go.

## Cuándo usar este skill

- Al testear múltiples componentes juntos
- Al testear con dependencias externas
- Al validar flujos end-to-end

## Build Tags

```go
//go:build integration

package mypackage

func TestIntegration(t *testing.T) {
    // Tests que requieren recursos externos
}
```

```bash
# Solo unit tests
go test ./...

# Incluyendo integration tests
go test -tags=integration ./...
```

## Test con Validator Completo

```go
func TestFullValidation(t *testing.T) {
    if testing.Short() {
        t.Skip("skipping integration test")
    }

    v, err := validator.NewInitializedValidatorR4(ctx, opts)
    if err != nil {
        t.Fatal(err)
    }

    patient := loadFixture(t, "valid_patient.json")
    result, err := v.Validate(ctx, patient)

    if !result.Valid {
        t.Errorf("expected valid: %v", result.Errors)
    }
}
```

## Fixtures

```
testdata/
├── fixtures/
│   ├── valid_patient.json
│   └── invalid_patient.json
└── golden/
    └── expected_output.txt
```

## Golden Files

```go
var update = flag.Bool("update", false, "update golden files")

func TestOutput(t *testing.T) {
    result := generateOutput()
    goldenPath := "testdata/golden/output.txt"

    if *update {
        os.WriteFile(goldenPath, []byte(result), 0644)
        return
    }

    expected, _ := os.ReadFile(goldenPath)
    if result != string(expected) {
        t.Errorf("mismatch")
    }
}
```

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/gofhir) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-13 -->

