Skip to content

Commit 8beb7eb

Browse files
committed
add test
1 parent ffa56e3 commit 8beb7eb

1 file changed

Lines changed: 54 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,61 @@ jobs:
8181
path: dist/${{ matrix.artifact }}
8282
retention-days: 30
8383

84-
release:
84+
integration-test:
8585
needs: [build]
86+
runs-on: ubuntu-22.04
87+
name: Integration Test (linux-x64)
88+
89+
steps:
90+
- name: Download linux-x64 binary
91+
uses: actions/download-artifact@v4
92+
with:
93+
name: semble-linux-x64
94+
95+
- name: Make executable
96+
run: chmod +x semble-linux-x64
97+
98+
- name: Clone a test repo
99+
run: git clone --depth 1 https://github.com/MinishLab/model2vec test-repo
100+
101+
- name: Test search
102+
run: |
103+
OUTPUT=$(./semble-linux-x64 search "save model to disk" ./test-repo)
104+
echo "$OUTPUT"
105+
echo "$OUTPUT" | python3 -c "import sys, json; data = json.load(sys.stdin); assert len(data['results']) > 0, 'No results returned'"
106+
107+
- name: Test find-related
108+
run: |
109+
OUTPUT=$(./semble-linux-x64 search "load pretrained" ./test-repo)
110+
FILE=$(echo "$OUTPUT" | python3 -c "import sys, json; print(json.load(sys.stdin)['results'][0]['chunk']['file_path'])")
111+
echo "Using file: $FILE"
112+
RELATED=$(./semble-linux-x64 find-related "$FILE" 1 ./test-repo)
113+
echo "$RELATED"
114+
echo "$RELATED" | python3 -c "import sys, json; data = json.load(sys.stdin); assert len(data['results']) > 0, 'No related results'"
115+
116+
- name: Test search with --content all
117+
run: |
118+
OUTPUT=$(./semble-linux-x64 search "installation" ./test-repo --content all)
119+
echo "$OUTPUT"
120+
echo "$OUTPUT" | python3 -c "import sys, json; data = json.load(sys.stdin); assert len(data['results']) > 0, 'No results with --content all'"
121+
122+
- name: Test search with top-k
123+
run: |
124+
OUTPUT=$(./semble-linux-x64 search "tokenizer" ./test-repo -k 3)
125+
echo "$OUTPUT"
126+
echo "$OUTPUT" | python3 -c "import sys, json; data = json.load(sys.stdin); assert len(data['results']) <= 3, 'top-k not respected'"
127+
128+
- name: Test init
129+
run: |
130+
./semble-linux-x64 init --agent claude
131+
test -f .claude/agents/semble-search.md
132+
echo "Init created agent file successfully"
133+
134+
- name: Test savings
135+
run: ./semble-linux-x64 savings
136+
137+
release:
138+
needs: [build, integration-test]
86139
runs-on: ubuntu-latest
87140
if: startsWith(github.ref, 'refs/tags/')
88141

0 commit comments

Comments
 (0)