Skip to content

Commit 5149abc

Browse files
committed
chore: remove live dataset guards and broken tests
1 parent c49c5b7 commit 5149abc

24 files changed

Lines changed: 37 additions & 468 deletions

AGENTS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ These instructions apply to the entire repository.
1616
- Always format after code edits. Use `make format` unless a narrower formatting command is clearly sufficient for the touched files.
1717
- `make test_all` is the default validation command. It runs unit tests and all integration suites.
1818
- Integration suites consume `CONNECTION_STRING`. If `CONNECTION_STRING` is not present in the LLM context, ask the user to add it before running `make test_all`.
19-
- Destructive integration suites also require `DAWGS_INTEGRATION_ALLOW_DESTRUCTIVE=1` and an exact credential-free target in `DAWGS_INTEGRATION_DISPOSABLE_TARGETS`. Never add the live benchmark database to that allowlist.
2019
- Run `make test_all` only for the backend selected by the scheme in `CONNECTION_STRING`. Tests for other backends should skip themselves.
2120
- Core integration cases in `integration/testdata/cases` and `integration/testdata/templates` must be backend-equivalent. Do not add driver-specific skips or driver-specific expected assertions to these suites. If a backend capability needs dedicated coverage, put it in a clearly driver-scoped test that is skipped unless `CONNECTION_STRING` selects that backend.
2221
- `make test` is available for unit tests only.

Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ test_all: test test_integration test_bdd_integration
129129

130130
test_integration:
131131
@echo "Running all integration tests..."
132-
@$(GO_CMD) run ./cmd/integrationguard
133132
@$(GO_CMD) test -tags 'manual_integration integration' -race -cover -count=1 -p=1 -parallel=1 $(MAIN_PACKAGES)
134133
test_bdd_integration:
135134
@echo "Running all BDD integration tests..."
@@ -144,12 +143,10 @@ bench_diff:
144143

145144
test_neo4j:
146145
@echo "Running Neo4j integration tests..."
147-
@$(GO_CMD) run ./cmd/integrationguard
148146
@$(GO_CMD) test -tags integration -race -cover -count=1 -p=1 -parallel=1 $(MAIN_PACKAGES)
149147

150148
test_pg:
151149
@echo "Running PostgreSQL integration tests..."
152-
@$(GO_CMD) run ./cmd/integrationguard
153150
@$(GO_CMD) test -tags manual_integration -race -cover -count=1 -p=1 -parallel=1 $(MAIN_PACKAGES)
154151

155152
test_update:
@@ -304,8 +301,6 @@ quality_backend: test
304301
echo "PG_CONNECTION_STRING and NEO4J_CONNECTION_STRING are required."; \
305302
exit 1; \
306303
fi
307-
@CONNECTION_STRING="$(PG_CONNECTION_STRING)" $(GO_CMD) run ./cmd/integrationguard
308-
@CONNECTION_STRING="$(NEO4J_CONNECTION_STRING)" $(GO_CMD) run ./cmd/integrationguard
309304
@set +e; \
310305
CONNECTION_STRING="$(PG_CONNECTION_STRING)" $(GO_CMD) test -json -tags 'manual_integration integration' -race -cover -count=1 -p=1 -parallel=1 $(MAIN_PACKAGES) > $(BACKEND_PG_REPORT); \
311306
pg_status=$$?; \

README.md

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ Export the `CONNECTION_STRING` environment variable for the PostgreSQL or Neo4j
8989

9090
```bash
9191
export CONNECTION_STRING="postgresql://dawgs:weneedbetterpasswords@localhost:65432/dawgs"
92-
export DAWGS_INTEGRATION_ALLOW_DESTRUCTIVE=1
93-
export DAWGS_INTEGRATION_DISPOSABLE_TARGETS="postgresql://localhost:65432/dawgs"
9492
make test_integration
9593
```
9694

@@ -99,10 +97,9 @@ export CONNECTION_STRING="postgresql://dawgs:weneedbetterpasswords@localhost:654
9997
make test_bdd_integration
10098
```
10199

102-
Integration suites and fixture-loading GraphBench runs delete graph data. The
103-
acknowledgement and credential-free target allowlist above are both required;
104-
an absent or mismatched target is rejected before testing. Existing-graph
105-
GraphBench runs reject mutating cases and do not require destructive
100+
Integration suites and fixture-loading GraphBench runs delete graph data.
101+
Existing-graph GraphBench runs reject mutating cases and do not require
102+
fixture loading.
106103
acknowledgement. PostgreSQL sessions remain read-write so temporary traversal
107104
workspaces use the same reset strategy as production.
108105

@@ -128,9 +125,7 @@ measures real driver batch APIs. It reloads or clears its fixture outside the
128125
timed region and validates post-state after every iteration:
129126

130127
```bash
131-
DAWGS_INTEGRATION_ALLOW_DESTRUCTIVE=1 \
132-
DAWGS_INTEGRATION_DISPOSABLE_TARGETS="postgresql://localhost:65432/dawgs" \
133-
CONNECTION_STRING="postgresql://dawgs:weneedbetterpasswords@localhost:65432/dawgs" \
128+
CONNECTION_STRING="postgresql://dawgs:weneedbetterpasswords@localhost:65432/dawgs" \
134129
go test -tags manual_integration ./integration -run '^$' \
135130
-bench BenchmarkMutationSafeDirectWrites -benchtime=1x
136131
```
@@ -160,9 +155,7 @@ edge-kind-selective, and multi-path shortest-path scenarios before recording tim
160155
`make plan_corpus` captures plan diagnostics for the shared Cypher integration corpus. It accepts either
161156
`CONNECTION_STRING` for one backend or `PG_CONNECTION_STRING` and `NEO4J_CONNECTION_STRING` for both backends, then
162157
writes JSONL captures and markdown/JSON summaries under `.coverage/`. Captures record the DAWGS source version, which
163-
can be overridden with a command flag when needed. Because it reloads fixtures, it also requires
164-
`DAWGS_INTEGRATION_ALLOW_DESTRUCTIVE=1` and every selected credential-free target in
165-
`DAWGS_INTEGRATION_DISPOSABLE_TARGETS`.
158+
can be overridden with a command flag when needed. It reloads fixtures for each selected backend.
166159

167160
`go run ./cmd/graphbench` captures runtime diagnostics for the scale corpus under `benchmark/testdata/scale`. The
168161
implemented execution modes are `postgres_sql` and `neo4j`; `local_traversal` is an explicit, non-gating
@@ -362,9 +355,7 @@ cardinality, and checks stable mutation-target and anchored edge-index
362355
invariants. Run it directly with:
363356

364357
```bash
365-
DAWGS_INTEGRATION_ALLOW_DESTRUCTIVE=1 \
366-
DAWGS_INTEGRATION_DISPOSABLE_TARGETS="postgresql://localhost:65432/dawgs" \
367-
CONNECTION_STRING="postgresql://dawgs:weneedbetterpasswords@localhost:65432/dawgs" \
358+
CONNECTION_STRING="postgresql://dawgs:weneedbetterpasswords@localhost:65432/dawgs" \
368359
go test -tags manual_integration ./cmd/graphbench \
369360
-run 'Test(PostgreSQLScalePlanInvariants|ScaleCorpusRequiredRepresentativesDeclareCardinality)' \
370361
-count=1

cmd/benchmark/main_integration_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
"github.com/specterops/dawgs/cypher/frontend"
3131
"github.com/specterops/dawgs/cypher/models/pgsql/optimize"
3232
"github.com/specterops/dawgs/cypher/models/pgsql/translate"
33-
"github.com/specterops/dawgs/databaseguard"
3433
"github.com/specterops/dawgs/drivers/pg"
3534
"github.com/specterops/dawgs/graph"
3635
"github.com/specterops/dawgs/util/size"
@@ -47,9 +46,6 @@ func postgresBenchmarkIntegrationConnection(t *testing.T) string {
4746
if !strings.HasPrefix(normalized, "postgres://") && !strings.HasPrefix(normalized, "postgresql://") {
4847
t.Skip("CONNECTION_STRING is not a PostgreSQL connection string")
4948
}
50-
if err := databaseguard.ValidateEnvironment(connection); err != nil {
51-
t.Fatalf("integration database safety check failed: %v", err)
52-
}
5349
return connection
5450
}
5551

cmd/graphbench/README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,9 @@ malformed, duplicated, mismatched, or unchecksummed untracked entries/copies.
5050

5151
GraphBench clears and reloads fixtures. A non-blocking local lock at
5252
`.coverage/graphbench.lock` prevents overlapping processes; override it with
53-
`-destructive-lock`. Runners on different hosts must use distinct disposable
54-
databases because a filesystem lock cannot coordinate across machines.
55-
Fixture-loading runs also require `DAWGS_INTEGRATION_ALLOW_DESTRUCTIVE=1` and
56-
an exact credential-free target in `DAWGS_INTEGRATION_DISPOSABLE_TARGETS`, for
57-
example `postgresql://localhost:65432/dawgs`. Non-mutating `-existing-graph`
58-
runs do not require this acknowledgement; their PostgreSQL sessions remain
53+
`-destructive-lock`. Runners on different hosts must use distinct databases
54+
because a filesystem lock cannot coordinate across machines. Non-mutating
55+
`-existing-graph` runs reject writes; their PostgreSQL sessions remain
5956
read-write so temporary workspace behavior matches production.
6057

6158
## Examples
@@ -1814,9 +1811,7 @@ uses rollback isolation for writes and runs automatically under
18141811
Run only the scale-plan gate with:
18151812

18161813
```bash
1817-
DAWGS_INTEGRATION_ALLOW_DESTRUCTIVE=1 \
1818-
DAWGS_INTEGRATION_DISPOSABLE_TARGETS="postgresql://localhost:65432/dawgs" \
1819-
CONNECTION_STRING="$PG_CONNECTION_STRING" \
1814+
CONNECTION_STRING="$PG_CONNECTION_STRING" \
18201815
go test -tags manual_integration ./cmd/graphbench \
18211816
-run 'Test(PostgreSQLScalePlanInvariants|ScaleCorpusRequiredRepresentativesDeclareCardinality)' \
18221817
-count=1

cmd/graphbench/destructive_guard_test.go

Lines changed: 0 additions & 26 deletions
This file was deleted.

cmd/graphbench/main.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
"time"
3030

3131
"github.com/specterops/dawgs/cypher/models/pgsql/optimize"
32-
"github.com/specterops/dawgs/databaseguard"
3332
"github.com/specterops/dawgs/testutil"
3433
)
3534

@@ -1495,9 +1494,6 @@ func main() {
14951494
if pgConnection == "" {
14961495
fatal("P5 adjacency feasibility capture requires -pg-connection, -connection, PG_CONNECTION_STRING, or CONNECTION_STRING")
14971496
}
1498-
if err := databaseguard.ValidateEnvironment(pgConnection); err != nil {
1499-
fatal("refuse destructive P5 adjacency feasibility target: %v", err)
1500-
}
15011497
runLock, err := acquireDestructiveRunLock(cfg.DestructiveLock)
15021498
if err != nil {
15031499
fatal("acquire destructive run lock: %v", err)
@@ -1895,9 +1891,6 @@ func main() {
18951891
if connection == "" {
18961892
continue
18971893
}
1898-
if err := databaseguard.ValidateEnvironment(connection); err != nil {
1899-
fatal("refuse destructive GraphBench target: %v", err)
1900-
}
19011894
}
19021895

19031896
runLock, err := acquireDestructiveRunLock(cfg.DestructiveLock)

cmd/graphbench/neo4j.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525

2626
neo4jcore "github.com/neo4j/neo4j-go-driver/v5/neo4j"
2727
"github.com/specterops/dawgs"
28-
"github.com/specterops/dawgs/databaseguard"
2928
dawgsneo4j "github.com/specterops/dawgs/drivers/neo4j"
3029
"github.com/specterops/dawgs/graph"
3130
"github.com/specterops/dawgs/opengraph"
@@ -46,10 +45,6 @@ type neo4jRunner struct {
4645

4746
// newNeo4jRunner opens a Neo4j driver and selects the optional database encoded in the URI.
4847
func newNeo4jRunner(ctx context.Context, datasetDir, connection string, corpus ScaleCorpus) (*neo4jRunner, error) {
49-
if err := databaseguard.ValidateEnvironment(connection); err != nil {
50-
return nil, fmt.Errorf("refuse destructive Neo4j GraphBench target: %w", err)
51-
}
52-
5348
db, err := dawgs.Open(ctx, dawgsneo4j.DriverName, dawgs.Config{
5449
GraphQueryMemoryLimit: size.Gibibyte,
5550
ConnectionString: connection,

cmd/graphbench/p5_adjacency_feasibility.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919
"github.com/jackc/pgx/v5/pgconn"
2020
"github.com/jackc/pgx/v5/pgxpool"
2121
"github.com/specterops/dawgs"
22-
"github.com/specterops/dawgs/databaseguard"
2322
"github.com/specterops/dawgs/drivers/pg"
2423
pgquery "github.com/specterops/dawgs/drivers/pg/query"
2524
"github.com/specterops/dawgs/graph"
@@ -190,9 +189,6 @@ type p5AdjacencyRowQueryer interface {
190189
// deliberately separate from the normal corpus runner and does not load,
191190
// translate, or execute any Cypher query.
192191
func runP5AdjacencyFeasibilityCapture(ctx context.Context, cfg config, connection string, args []string) (_ P5AdjacencyFeasibilityReport, err error) {
193-
if err := databaseguard.ValidateEnvironment(connection); err != nil {
194-
return P5AdjacencyFeasibilityReport{}, err
195-
}
196192
if cfg.PoolSize != 1 {
197193
return P5AdjacencyFeasibilityReport{}, fmt.Errorf("P5 adjacency feasibility capture requires pool-size 1")
198194
}

cmd/graphbench/p5_adjacency_feasibility_integration_test.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,27 @@ package main
1010
import (
1111
"context"
1212
"os"
13+
"strings"
1314
"testing"
1415

1516
"github.com/jackc/pgx/v5"
1617
"github.com/jackc/pgx/v5/pgxpool"
17-
"github.com/specterops/dawgs/databaseguard"
1818
"github.com/stretchr/testify/require"
1919
)
2020

21+
func isPostgreSQLConnection(connection string) bool {
22+
normalized := strings.ToLower(connection)
23+
return strings.HasPrefix(normalized, "postgres://") || strings.HasPrefix(normalized, "postgresql://")
24+
}
25+
2126
func TestP5AdjacencyTaggedPGXStatementVisibleToPGStatStatements(t *testing.T) {
2227
connection := os.Getenv("CONNECTION_STRING")
2328
if connection == "" {
2429
t.Skip("CONNECTION_STRING env var is not set")
2530
}
26-
target, err := databaseguard.Target(connection)
27-
require.NoError(t, err)
28-
if len(target) < len("postgresql://") || target[:len("postgresql://")] != "postgresql://" {
31+
if !isPostgreSQLConnection(connection) {
2932
t.Skip("CONNECTION_STRING is not a PostgreSQL connection string")
3033
}
31-
require.NoError(t, databaseguard.ValidateEnvironment(connection))
3234

3335
ctx := context.Background()
3436
graphState, err := openP5AdjacencyGraph(ctx, connection)
@@ -67,12 +69,9 @@ func TestP5AdjacencyCalibrationAttributesTaggedStatementWAL(t *testing.T) {
6769
if connection == "" {
6870
t.Skip("CONNECTION_STRING env var is not set")
6971
}
70-
target, err := databaseguard.Target(connection)
71-
require.NoError(t, err)
72-
if len(target) < len("postgresql://") || target[:len("postgresql://")] != "postgresql://" {
72+
if !isPostgreSQLConnection(connection) {
7373
t.Skip("CONNECTION_STRING is not a PostgreSQL connection string")
7474
}
75-
require.NoError(t, databaseguard.ValidateEnvironment(connection))
7675

7776
ctx := context.Background()
7877
resetP5AdjacencyTestState(t, ctx, connection)

0 commit comments

Comments
 (0)