- Created `qa-test-output-after-fix.txt` and `qa-test-output.txt` to log results of certificate page authentication tests. - Added `build.sh` for deterministic backend builds in CI, utilizing `go list` for efficiency. - Introduced `codeql_scan.sh` for CodeQL database creation and analysis for Go and JavaScript/TypeScript. - Implemented `dockerfile_check.sh` to validate Dockerfiles for base image and package manager mismatches. - Added `sourcery_precommit_wrapper.sh` to facilitate Sourcery CLI usage in pre-commit hooks.
35 lines
983 B
Go
35 lines
983 B
Go
//go:build integration
|
|
// +build integration
|
|
|
|
package integration
|
|
|
|
import (
|
|
"context"
|
|
"os/exec"
|
|
"strings"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
// TestCrowdsecIntegration runs scripts/crowdsec_integration.sh and ensures it completes successfully.
|
|
func TestCrowdsecIntegration(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
cmd := exec.CommandContext(context.Background(), "bash", "./scripts/crowdsec_integration.sh")
|
|
// Ensure script runs from repo root so relative paths in scripts work reliably
|
|
cmd.Dir = "../../"
|
|
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute)
|
|
defer cancel()
|
|
cmd = exec.CommandContext(ctx, "bash", "./scripts/crowdsec_integration.sh")
|
|
cmd.Dir = "../../"
|
|
|
|
out, err := cmd.CombinedOutput()
|
|
t.Logf("crowdsec_integration script output:\n%s", string(out))
|
|
if err != nil {
|
|
t.Fatalf("crowdsec integration failed: %v", err)
|
|
}
|
|
if !strings.Contains(string(out), "Apply response: ") {
|
|
t.Fatalf("unexpected script output, expected Apply response in output")
|
|
}
|
|
}
|