forked from Dicklesworthstone/agentic_coding_flywheel_setup
-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (125 loc) · 4.68 KB
/
toon-integration-tests.yml
File metadata and controls
149 lines (125 loc) · 4.68 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
name: TOON Integration Tests
on:
push:
branches: [main]
paths:
- 'scripts/test_*.sh'
- 'scripts/verify_*.sh'
- '.github/workflows/toon-integration-tests.yml'
pull_request:
paths:
- 'scripts/test_*.sh'
- 'scripts/verify_*.sh'
workflow_dispatch:
schedule:
- cron: "0 6 * * 1" # Weekly on Monday 6 AM UTC
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
# Core TOON encode/decode tests (tru only - fast, no dependencies)
toon-core:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Install tru (toon_rust CLI)
run: cargo install --git https://github.com/Dicklesworthstone/toon_rust --locked
- name: Install jq
run: sudo apt-get install -y jq
- name: Test tru encode/decode round-trip
run: |
echo '{"a": 1, "b": [true, false], "c": {"nested": "value"}}' > test.json
tru --encode test.json > test.toon
tru --decode test.toon > decoded.json
# Verify round-trip
if ! diff <(jq -S . test.json) <(jq -S . decoded.json); then
echo "FAIL: Round-trip mismatch"
exit 1
fi
echo "PASS: tru encode/decode round-trip"
- name: Test TOON_DEFAULT_FORMAT env var
run: |
export TOON_DEFAULT_FORMAT=toon
echo '{"test": 123}' | tru > output.txt
# Should be TOON format (not JSON)
if head -1 output.txt | grep -q '^{'; then
echo "FAIL: TOON_DEFAULT_FORMAT not respected"
exit 1
fi
echo "PASS: TOON_DEFAULT_FORMAT respected"
- name: Test key folding
run: |
echo '{"config": {"db": {"host": "localhost", "port": 5432}}}' | tru --encode --key-folding safe > folded.toon
grep -q "config.db" folded.toon && echo "PASS: Key folding works"
- name: Test tabular arrays
run: |
echo '[{"id": 1, "name": "Alice"}, {"id": 2, "name": "Bob"}]' | tru --encode > tabular.toon
tru --decode tabular.toon | jq -e '.[0].id == 1' >/dev/null
echo "PASS: Tabular arrays work"
# Script syntax validation (shellcheck)
lint-scripts:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Install shellcheck
run: sudo apt-get install -y shellcheck
- name: Lint test scripts
run: |
cd scripts
for script in test_*.sh verify_*.sh check_*.sh; do
if [[ -f "$script" ]]; then
echo "Checking $script..."
shellcheck -x "$script" || echo "WARN: $script has shellcheck issues"
fi
done
# Full integration tests (requires all tools - manual trigger or self-hosted)
full-integration:
runs-on: ubuntu-latest
timeout-minutes: 30
if: github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Install core dependencies
run: |
sudo apt-get update
sudo apt-get install -y jq
- name: Install tru
run: cargo install --git https://github.com/Dicklesworthstone/toon_rust --locked
- name: Install br (beads_rust)
run: cargo install --git https://github.com/Dicklesworthstone/beads_rust --locked
continue-on-error: true
- name: Note about full integration
run: |
echo "==========================================="
echo "TOON FULL INTEGRATION TEST NOTES"
echo "==========================================="
echo ""
echo "Full cross-tool integration tests require:"
echo " - All Dicklesworthstone tools installed"
echo " - Properly configured indexes (cass, xf)"
echo " - Test fixtures and workspaces"
echo ""
echo "For complete testing, run locally:"
echo " /data/projects/scripts/test_full_integration.sh"
echo ""
echo "Individual test scripts:"
echo " test_cross_tool_interop.sh - TOON encoding/decoding"
echo " check_robot_help_consistency.sh - Help patterns"
echo " test_error_consistency.sh - Exit codes"
echo " verify_token_savings.sh - Token reduction"
echo ""
echo "Core tru tests passed in toon-core job."