Skip to content

Commit 37f73d6

Browse files
committed
Test fixes.
1 parent e7281a7 commit 37f73d6

8 files changed

Lines changed: 50 additions & 40 deletions

File tree

CLAUDE.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ ReqFlow is an AI-driven framework for system modeling and requirements managemen
1111
- **Linting**: Modular system for validating and fixing markdown formatting issues
1212

1313
## Command Line Usage
14-
- Initialize ReqFlow: `reqflow init`
15-
- Validate requirements: `reqflow validate specifications/`
16-
- Generate HTML: `reqflow specifications/ output/ --html`
17-
- Lint requirements: `reqflow --lint specifications/`
18-
- Generate diagrams: `reqflow --lint specifications/ --generate-diagrams`
14+
- Validate requirements: `reqflow --validate`
15+
- Generate HTML: `reqflow --html`
16+
- Lint requirements: `reqflow --lint --dry-run`
17+
- Generate diagrams: `reqflow --generate-diagrams`
18+
- Show Change Impact: `reqflow --change-impact --git-comit=HEAD~1`
1919

2020
## Build and Test Commands
2121
- Build: `cargo build`
@@ -25,18 +25,10 @@ ReqFlow is an AI-driven framework for system modeling and requirements managemen
2525
- Lint: `cargo clippy -- -D warnings`
2626
- Format: `cargo fmt`
2727

28-
## Dependencies
29-
- Markdown parsing: `pulldown-cmark`
30-
- HTML generation: `maud`
31-
- Path handling: `camino`
32-
- Command line: `clap` with derive feature
33-
- Regex: `regex`
3428

3529
## Key File Locations
36-
- Configuration example: `reqflow.yml.example`
37-
- Design specifications: `specifications/DesignSpecifications/`
38-
- Test fixtures: `test-fixtures/`
39-
- E2E tests: `tests/e2e-*/`
30+
- Requirements and Specifications: `specifications/**/*.md`
31+
- E2E tests: `tests/*/`
4032

4133
## Code Style Guidelines
4234
- Follow Rust standard naming conventions
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Design Specification: Excluded File
2+
3+
This file should be excluded from processing.
4+
5+
## Overview
6+
7+
This document describes the design of a feature.
8+
9+
### DSD-001 Design Element
10+
11+
This is a design element that should not be processed.
12+
13+
```markdown
14+
15+
Test.
16+
```

tests/test-excluded-patterns/specifications/SystemRequirements/ValidFile.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This file should be processed.
99
This is a system requirement.
1010

1111
#### Metadata
12-
* type: requirement
12+
* type: user-requirement
1313

1414
#### Relations
1515
* satisfiedBy: [../DesignSpecifications/ExcludedFile.md](../DesignSpecifications/ExcludedFile.md)
@@ -21,8 +21,8 @@ This is a system requirement.
2121
Users must be able to send direct messages to other users.
2222

2323
#### Metadata
24-
* type: requirement
24+
* type: user-requirement
2525
* priority: high
2626

2727
#### Relations
28-
* satisfiedBy: [DesignSpecifications/DirectMessages.md](DesignSpecifications/DirectMessages.md)
28+
* satisfiedBy: [../DesignSpecifications/DirectMessages.md](../DesignSpecifications/DirectMessages.md)

tests/test-excluded-patterns/test.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,24 @@ OUTPUT=$(cd "$TEST_DIR" && "$REQFLOW_BIN" --config "${TEST_DIR}/reqflow.yaml" -
1717
EXIT_CODE=$?
1818

1919

20+
2021
printf "%s\n" "$OUTPUT" > "${TEST_DIR}/test_results.log"
2122

23+
if [[ $EXIT_CODE -ne 0 ]]; then
24+
exit $EXIT_CODE
25+
fi
26+
27+
2228
# There should be no errors about excluded file relations being invalid
23-
if echo "$OUTPUT" | grep -q "Missing relation target.*DesignSpecifications/ExcludedFile.md"; then
29+
if echo "$OUTPUT" | grep -q "Missing relation target"; then
2430
echo "FAILED: Relation to excluded file was incorrectly reported as invalid"
2531
exit 1
2632
fi
2733

2834
# There should also be no elements from excluded files in the registry
29-
# Check this by looking for validation of relations FROM excluded files
30-
# This is trickier to test without having access to the internal registry
31-
# We'll use a heuristic: if the relation from DSD-001 is validated, it means
32-
# the element was processed, which is incorrect
33-
if echo "$OUTPUT" | grep -q "DSD-001"; then
35+
OUTPUT=$(cd "$TEST_DIR" && "$REQFLOW_BIN" --config "${TEST_DIR}/reqflow.yaml" --model-summary | grep -n 'Element:')
36+
37+
if echo "$OUTPUT" | grep -q "DesignSpecifications"; then
3438
echo "FAILED: Elements from excluded files are being processed"
3539
exit 1
3640
fi

tests/test-external-folders/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ EXIT_CODE=$?
77
printf "%s\n" "$OUTPUT" > "${TEST_DIR}/test_results.log"
88

99

10-
if [[ $status -ne 0 ]]; then
10+
if [[ $EXIT_CODE -ne 0 ]]; then
1111
exit $EXIT_CODE
1212
fi
1313

tests/test-fragment-relations/test.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ if [ $EXIT_CODE -ne 0 ]; then
2828
exit 1
2929
fi
3030

31-
3231
# Verify that successful validation message is displayed
3332
if ! echo "$OUTPUT" | grep -q "Validation completed successfully with no errors."; then
3433
echo "FAILED: Missing success message for relation validation"

tests/test-invalid-relations/test.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
# Test: Validation of Invalid Relation Types and Formats
44
# ----------------------------------------------------
55
# Acceptance Criteria:
6-
# - System should detect and report invalid relation types (typos, etc.)
7-
# - System should detect and report relations to non-existent targets
8-
# - System should detect and report if system requirement is missing parent relation
9-
# - System should detect and report if there is circular dependency in requirements
10-
# - System should detect and report if relation type has incompactible element
11-
# - System should detect and report invalid metadata subsection format
12-
# - System should detect and report duplicate relations in Relations subsection
13-
# - System should detect and report duplicate elements
14-
# - System should detect and report duplicate subsections
6+
# - System should detect and report Duplicate element
7+
# - System should detect and report Invalid metadata format
8+
# - System should detect and report Invalid relation format
9+
# - System should detect and report Unsupported relation type
10+
# - System should detect and report Invalid identifier
11+
# - System should detect and report Duplicate subsection
12+
# - System should detect and report Incompatible element types for relation
13+
# - System should detect and report Circular dependency error
14+
# - System should detect and report Missing parent relation"
1515
#
1616
# Test Criteria:
1717
# - Command exits with 0 error code but outputs expected validation errors

tests/test-lint-expected/test.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
# Test: Whitespace Linting Functionality
44
# --------------------------------------
55
# Acceptance Criteria:
6-
# - System should detect excess whitespace after headers
7-
# - System should fix excess whitespace in linting mode
8-
# - The output should show before/after changes
6+
# - The dry-run output should show before/after changes with specific expected lint commands to be applied
7+
# - The lint should apply expected fixes
98
#
109
# Test Criteria:
1110
# - Command exits with success (0) return code
12-
# - Output shows whitespace being fixed
13-
# - Output should contain diff-style formatting
11+
# - Dry-run Output should contain diff-style formatting
12+
# - The lint should apply expected fixes and produce expected output
1413
#
1514

1615

0 commit comments

Comments
 (0)