-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
157 lines (145 loc) · 5.58 KB
/
Makefile
File metadata and controls
157 lines (145 loc) · 5.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
.PHONY: test test-all test-file test-sqs test-dynamodb test-logs test-utilities test-autogen test-workflows test-wrappers clean help
# Default target
help:
@echo "Available test commands:"
@echo " test - Run all tests (alias for test-all)"
@echo " test-all - Run all tests"
@echo " test-file FILE= - Run specific test file"
@echo " test-sqs - Run SQS workflow tests"
@echo " test-dynamodb - Run DynamoDB workflow tests"
@echo " test-logs - Run CloudWatch Logs workflow tests"
@echo " test-utilities - Run utility tests"
@echo " test-autogen - Run autogen wrapper tests"
@echo " test-workflows - Run all workflow tests"
@echo " test-wrappers - Run wrapper tests (legacy + autogen)"
@echo " clean - Clean test artifacts"
@echo ""
@echo "Examples:"
@echo " make test-file FILE=lua/spec/nvim-aws/workflows/sqs/main_spec.lua"
@echo " make test-sqs"
# Run all tests
test-all:
@echo "=============================================="
@echo " Running All Tests"
@echo "=============================================="
@total=0; passed=0; failed=0; \
for test_file in $$(find lua/spec -name "*_spec.lua" | sort); do \
total=$$((total + 1)); \
echo "Running $$test_file..."; \
if nvim --headless +"PlenaryBustedFile $$test_file" +qall >/dev/null 2>&1; then \
echo "✓ PASSED: $$test_file"; \
passed=$$((passed + 1)); \
else \
echo "✗ FAILED: $$test_file"; \
failed=$$((failed + 1)); \
echo " Error details:"; \
nvim --headless +"PlenaryBustedFile $$test_file" +qall 2>&1 | head -10 | sed 's/^/ /'; \
fi; \
done; \
echo ""; \
echo "============================================== "; \
echo " Test Summary"; \
echo "============================================== "; \
echo "Total: $$total | Passed: $$passed | Failed: $$failed"; \
if [ $$failed -eq 0 ]; then \
echo "🎉 All tests passed!"; \
else \
echo "❌ $$failed test(s) failed"; \
exit 1; \
fi
# Run specific test file
test-file:
ifndef FILE
$(error FILE is required. Usage: make test-file FILE=lua/spec/nvim-aws/workflows/sqs/main_spec.lua)
endif
@echo "Running test file: $(FILE)"
@nvim --headless +"PlenaryBustedFile $(FILE)" +qall
# Run SQS workflow tests
test-sqs:
@echo "=============================================="
@echo " Running SQS Tests"
@echo "=============================================="
@for test_file in lua/spec/nvim-aws/workflows/sqs/*_spec.lua; do \
if [ -f "$$test_file" ]; then \
echo "Running $$test_file..."; \
nvim --headless +"PlenaryBustedFile $$test_file" +qall || exit 1; \
fi; \
done
@echo "SQS tests completed successfully!"
# Run DynamoDB workflow tests
test-dynamodb:
@echo "=============================================="
@echo " Running DynamoDB Tests"
@echo "=============================================="
@for test_file in $$(find lua/spec/nvim-aws/workflows/dynamodb -name "*_spec.lua" 2>/dev/null || true); do \
if [ -f "$$test_file" ]; then \
echo "Running $$test_file..."; \
nvim --headless +"PlenaryBustedFile $$test_file" +qall || exit 1; \
fi; \
done
@echo "DynamoDB tests completed successfully!"
# Run CloudWatch Logs workflow tests
test-logs:
@echo "=============================================="
@echo " Running CloudWatch Logs Tests"
@echo "=============================================="
@for test_file in $$(find lua/spec/nvim-aws/workflows/logs -name "*_spec.lua" 2>/dev/null || true); do \
if [ -f "$$test_file" ]; then \
echo "Running $$test_file..."; \
nvim --headless +"PlenaryBustedFile $$test_file" +qall || exit 1; \
fi; \
done
@echo "Logs tests completed successfully!"
# Run utility tests
test-utilities:
@echo "=============================================="
@echo " Running Utility Tests"
@echo "=============================================="
@for test_file in $$(find lua/spec/nvim-aws/utilities -name "*_spec.lua" 2>/dev/null || true); do \
if [ -f "$$test_file" ]; then \
echo "Running $$test_file..."; \
nvim --headless +"PlenaryBustedFile $$test_file" +qall || exit 1; \
fi; \
done
@echo "Utility tests completed successfully!"
# Run autogen wrapper tests
test-autogen:
@echo "=============================================="
@echo " Running Autogen Wrapper Tests"
@echo "=============================================="
@for test_file in $$(find lua/spec/nvim-aws/autogen_wrappers -name "*_spec.lua" 2>/dev/null || true); do \
if [ -f "$$test_file" ]; then \
echo "Running $$test_file..."; \
nvim --headless +"PlenaryBustedFile $$test_file" +qall || exit 1; \
fi; \
done
@echo "Autogen wrapper tests completed successfully!"
# Run all workflow tests
test-workflows:
@echo "=============================================="
@echo " Running All Workflow Tests"
@echo "=============================================="
@$(MAKE) test-sqs
@$(MAKE) test-dynamodb
@$(MAKE) test-logs
# Run wrapper tests (legacy + autogen)
test-wrappers:
@echo "=============================================="
@echo " Running All Wrapper Tests"
@echo "=============================================="
@$(MAKE) test-autogen
@for test_file in $$(find lua/spec/nvim-aws/wrappers -name "*_spec.lua" 2>/dev/null || true); do \
if [ -f "$$test_file" ]; then \
echo "Running $$test_file..."; \
nvim --headless +"PlenaryBustedFile $$test_file" +qall || exit 1; \
fi; \
done
@echo "Wrapper tests completed successfully!"
# Clean test artifacts
clean:
@echo "Cleaning test artifacts..."
@find . -name "*.tmp" -delete 2>/dev/null || true
@find . -name "*.log" -delete 2>/dev/null || true
@echo "Clean completed!"
# Alias for convenience
test: test-all