Add scripttest-based integration tests (#59)
- Complete test coverage for all major bd commands: blocked, close, create, dep (add/remove/tree), export, help, import, init, list, quickstart, ready, show, stats, update, version - Test data files validate command behavior and output - Enables automated testing of full CLI workflows
This commit is contained in:
7
cmd/bd/testdata/blocked.txt
vendored
Normal file
7
cmd/bd/testdata/blocked.txt
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# Test bd blocked command
|
||||
bd init --prefix test
|
||||
bd create 'First issue'
|
||||
bd create 'Second issue' --deps test-1
|
||||
bd blocked
|
||||
stdout 'Blocked issues'
|
||||
stdout 'test-2'
|
||||
8
cmd/bd/testdata/close.txt
vendored
Normal file
8
cmd/bd/testdata/close.txt
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Test bd close command
|
||||
bd init --prefix test
|
||||
bd create 'Issue to close'
|
||||
bd close test-1 --reason 'Fixed'
|
||||
stdout 'Closed test-1'
|
||||
|
||||
bd show test-1
|
||||
stdout 'closed'
|
||||
5
cmd/bd/testdata/create.txt
vendored
Normal file
5
cmd/bd/testdata/create.txt
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# Test bd create command
|
||||
bd init --prefix test
|
||||
bd create 'Test issue'
|
||||
stdout 'Created issue:'
|
||||
stdout 'test-'
|
||||
10
cmd/bd/testdata/dep_add.txt
vendored
Normal file
10
cmd/bd/testdata/dep_add.txt
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# Test bd dep add command
|
||||
bd init --prefix test
|
||||
bd create 'First issue'
|
||||
bd create 'Second issue'
|
||||
bd dep add test-2 test-1
|
||||
stdout 'Added dependency'
|
||||
|
||||
bd show test-2
|
||||
stdout 'Depends on'
|
||||
stdout 'test-1'
|
||||
10
cmd/bd/testdata/dep_remove.txt
vendored
Normal file
10
cmd/bd/testdata/dep_remove.txt
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# Test bd dep remove command
|
||||
bd init --prefix test
|
||||
bd create 'First issue'
|
||||
bd create 'Second issue'
|
||||
bd dep add test-2 test-1
|
||||
bd dep remove test-2 test-1
|
||||
stdout 'Removed dependency'
|
||||
|
||||
bd show test-2
|
||||
! stdout 'test-1'
|
||||
7
cmd/bd/testdata/dep_tree.txt
vendored
Normal file
7
cmd/bd/testdata/dep_tree.txt
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# Test bd dep tree command
|
||||
bd init --prefix test
|
||||
bd create 'Root issue'
|
||||
bd create 'Child issue'
|
||||
bd dep add test-2 test-1
|
||||
bd dep tree test-1
|
||||
stdout 'test-1'
|
||||
10
cmd/bd/testdata/export.txt
vendored
Normal file
10
cmd/bd/testdata/export.txt
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# Test bd export command
|
||||
bd init --prefix test
|
||||
bd create 'Test issue'
|
||||
bd export -o export.jsonl
|
||||
exists export.jsonl
|
||||
|
||||
# Verify the exported file contains the issue
|
||||
bd import -i export.jsonl
|
||||
bd list
|
||||
stdout 'Test issue'
|
||||
7
cmd/bd/testdata/help.txt
vendored
Normal file
7
cmd/bd/testdata/help.txt
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# Test bd help command
|
||||
bd help
|
||||
stdout 'Usage:'
|
||||
stdout 'Available Commands:'
|
||||
stdout 'create'
|
||||
stdout 'list'
|
||||
stdout 'show'
|
||||
8
cmd/bd/testdata/import.txt
vendored
Normal file
8
cmd/bd/testdata/import.txt
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Test bd import command
|
||||
bd init --prefix test
|
||||
bd import -i import.jsonl
|
||||
bd show test-99
|
||||
stdout 'Imported issue'
|
||||
|
||||
-- import.jsonl --
|
||||
{"id":"test-99","title":"Imported issue","status":"open","priority":1,"issue_type":"task","created_at":"2025-01-01T00:00:00Z","updated_at":"2025-01-01T00:00:00Z"}
|
||||
4
cmd/bd/testdata/init.txt
vendored
Normal file
4
cmd/bd/testdata/init.txt
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# Test bd init command
|
||||
bd init --prefix test
|
||||
stdout 'initialized successfully'
|
||||
exists .beads/test.db
|
||||
7
cmd/bd/testdata/list.txt
vendored
Normal file
7
cmd/bd/testdata/list.txt
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# Test bd list command
|
||||
bd init --prefix test
|
||||
bd create 'First issue'
|
||||
bd create 'Second issue'
|
||||
bd list
|
||||
stdout 'First issue'
|
||||
stdout 'Second issue'
|
||||
5
cmd/bd/testdata/quickstart.txt
vendored
Normal file
5
cmd/bd/testdata/quickstart.txt
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# Test bd quickstart command
|
||||
bd quickstart
|
||||
stdout 'Dependency-Aware'
|
||||
stdout 'bd init'
|
||||
stdout 'bd create'
|
||||
5
cmd/bd/testdata/ready.txt
vendored
Normal file
5
cmd/bd/testdata/ready.txt
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# Test bd ready command
|
||||
bd init --prefix test
|
||||
bd create 'Ready issue'
|
||||
bd ready
|
||||
stdout 'Ready'
|
||||
8
cmd/bd/testdata/show.txt
vendored
Normal file
8
cmd/bd/testdata/show.txt
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Test bd show command
|
||||
bd init --prefix test
|
||||
bd create 'Test issue for show'
|
||||
|
||||
bd show test-1
|
||||
stdout 'Test issue for show'
|
||||
stdout 'Status:'
|
||||
stdout 'Priority:'
|
||||
9
cmd/bd/testdata/stats.txt
vendored
Normal file
9
cmd/bd/testdata/stats.txt
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# Test bd stats command
|
||||
bd init --prefix test
|
||||
bd create 'First issue'
|
||||
bd create 'Second issue'
|
||||
bd close test-1
|
||||
bd stats
|
||||
stdout 'Total Issues:'
|
||||
stdout 'Open:'
|
||||
stdout 'Closed:'
|
||||
8
cmd/bd/testdata/update.txt
vendored
Normal file
8
cmd/bd/testdata/update.txt
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Test bd update command
|
||||
bd init --prefix test
|
||||
bd create 'Issue to update'
|
||||
bd update test-1 --status in_progress
|
||||
stdout 'Updated issue:'
|
||||
|
||||
bd show test-1
|
||||
stdout 'in_progress'
|
||||
3
cmd/bd/testdata/version.txt
vendored
Normal file
3
cmd/bd/testdata/version.txt
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Test bd version command
|
||||
bd version
|
||||
stdout 'bd version'
|
||||
Reference in New Issue
Block a user