Skip to content

Commit 07e472f

Browse files
committed
Simplify FIM tests
Signed-off-by: Radoslav Dimitrov <[email protected]>
1 parent 9d73e50 commit 07e472f

File tree

4 files changed

+9
-24
lines changed

4 files changed

+9
-24
lines changed

.github/workflows/integration-tests.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ jobs:
145145
function check_model_ready() {
146146
response=$(curl -s http://localhost:11434/api/generate -d '{
147147
"model": "qwen2.5-coder:0.5b",
148-
"prompt": "Why is the sky blue?",
148+
"prompt": "Hello",
149149
"stream": false
150150
}' 2>&1)
151151
@@ -246,7 +246,7 @@ jobs:
246246
echo -e "\nVerify the completions endpoint works\n"
247247
curl http://localhost:8000/v1/completions -H "Content-Type: application/json" -d '{
248248
"model": "Qwen/Qwen2.5-Coder-0.5B-Instruct",
249-
"prompt": ["How to make pizza"],
249+
"prompt": ["Hello"],
250250
"max_tokens": 100,
251251
"temperature": 0
252252
}'
@@ -269,6 +269,7 @@ jobs:
269269
docker logs vllm
270270
271271
- name: Tests - ${{ matrix.test-provider }}
272+
timeout-minutes: 15
272273
env:
273274
CODEGATE_PROVIDERS: ${{ matrix.test-provider }}
274275
run: |

tests/integration/anthropic/testcases.yaml

+2-8
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,15 @@ testcases:
5050
"content": [
5151
{
5252
"type": "text",
53-
"text": "You are a HOLE FILLER. You are provided with a file containing holes, formatted as '{{HOLE_NAME}}'. Your TASK is to complete with a string to replace this hole with, inside a <COMPLETION/> XML tag, including context-aware indentation, if needed. All completions MUST be truthful, accurate, well-written and correct.\n\n## EXAMPLE QUERY:\n\n<QUERY>\nfunction sum_evens(lim) {\n var sum = 0;\n for (var i = 0; i < lim; ++i) {\n {{FILL_HERE}}\n }\n return sum;\n}\n</QUERY>\n\nTASK: Fill the {{FILL_HERE}} hole.\n\n## CORRECT COMPLETION\n\n<COMPLETION>if (i % 2 === 0) {\n sum += i;\n }</COMPLETION>\n\n## EXAMPLE QUERY:\n\n<QUERY>\ndef sum_list(lst):\n total = 0\n for x in lst:\n {{FILL_HERE}}\n return total\n\nprint sum_list([1, 2, 3])\n</QUERY>\n\n## CORRECT COMPLETION:\n\n<COMPLETION> total += x</COMPLETION>\n\n## EXAMPLE QUERY:\n\n<QUERY>\n// data Tree a = Node (Tree a) (Tree a) | Leaf a\n\n// sum :: Tree Int -> Int\n// sum (Node lft rgt) = sum lft + sum rgt\n// sum (Leaf val) = val\n\n// convert to TypeScript:\n{{FILL_HERE}}\n</QUERY>\n\n## CORRECT COMPLETION:\n\n<COMPLETION>type Tree<T>\n = {$:\"Node\", lft: Tree<T>, rgt: Tree<T>}\n | {$:\"Leaf\", val: T};\n\nfunction sum(tree: Tree<number>): number {\n switch (tree.$) {\n case \"Node\":\n return sum(tree.lft) + sum(tree.rgt);\n case \"Leaf\":\n return tree.val;\n }\n}</COMPLETION>\n\n## EXAMPLE QUERY:\n\nThe 5th {{FILL_HERE}} is Jupiter.\n\n## CORRECT COMPLETION:\n\n<COMPLETION>planet from the Sun</COMPLETION>\n\n## EXAMPLE QUERY:\n\nfunction hypothenuse(a, b) {\n return Math.sqrt({{FILL_HERE}}b ** 2);\n}\n\n## CORRECT COMPLETION:\n\n<COMPLETION>a ** 2 + </COMPLETION>\n\n<QUERY>\n# Path: Untitled.txt\n# http://127.0.0.1:8989/vllm/completions\n# codegate/test.py\nimport requests\n\ndef call_api():\n {{FILL_HERE}}\n\n\ndata = {'key1': 'test1', 'key2': 'test2'}\nresponse = call_api('http://localhost:8080', method='post', data='data')\n</QUERY>\nTASK: Fill the {{FILL_HERE}} hole. Answer only with the CORRECT completion, and NOTHING ELSE. Do it now.\n<COMPLETION>"
53+
"text": "You are a HOLE FILLER. You are provided with a file containing holes, formatted as '{{HOLE_NAME}}'. Your TASK is to complete with a string to replace this hole with, inside a <COMPLETION/> XML tag, including context-aware indentation, if needed. All completions MUST be truthful, accurate, well-written and correct.\n\n## EXAMPLE QUERY:\n\n<QUERY>\nfunction sum_evens(lim) {\n var sum = 0;\n for (var i = 0; i < lim; ++i) {\n {{FILL_HERE}}\n }\n return sum;\n}\n</QUERY>\n\nTASK: Fill the {{FILL_HERE}} hole.\n\n## CORRECT COMPLETION\n\n<COMPLETION>if (i % 2 === 0) {\n sum += i;\n }</COMPLETION>\n\n## EXAMPLE QUERY:\n\n<QUERY>\ndef sum_list(lst):\n total = 0\n for x in lst:\n {{FILL_HERE}}\n return total\n\nprint sum_list([1, 2, 3])\n</QUERY>\n\n## CORRECT COMPLETION:\n\n<COMPLETION> total += x</COMPLETION>\n\n## EXAMPLE QUERY:\n\n<QUERY>\n// data Tree a = Node (Tree a) (Tree a) | Leaf a\n\n// sum :: Tree Int -> Int\n// sum (Node lft rgt) = sum lft + sum rgt\n// sum (Leaf val) = val\n\n// convert to TypeScript:\n{{FILL_HERE}}\n</QUERY>\n\n## CORRECT COMPLETION:\n\n<COMPLETION>type Tree<T>\n = {$:\"Node\", lft: Tree<T>, rgt: Tree<T>}\n | {$:\"Leaf\", val: T};\n\nfunction sum(tree: Tree<number>): number {\n switch (tree.$) {\n case \"Node\":\n return sum(tree.lft) + sum(tree.rgt);\n case \"Leaf\":\n return tree.val;\n }\n}</COMPLETION>\n\n## EXAMPLE QUERY:\n\nThe 5th {{FILL_HERE}} is Jupiter.\n\n## CORRECT COMPLETION:\n\n<COMPLETION>planet from the Sun</COMPLETION>\n\n## EXAMPLE QUERY:\n\nfunction hypothenuse(a, b) {\n return Math.sqrt({{FILL_HERE}}b ** 2);\n}\n\n## CORRECT COMPLETION:\n\n<COMPLETION>a ** 2 + </COMPLETION>\n\n<QUERY>\n\ndef print_hello():\n {{FILL_HERE}}\n\n\nprint_hello()\n</QUERY>\nTASK: Fill the {{FILL_HERE}} hole. Answer only with the CORRECT completion, and NOTHING ELSE. Do it now.\n<COMPLETION>"
5454
}
5555
]
5656
}
5757
],
5858
"system": ""
5959
}
6060
likes: |
61-
<COMPLETION>def call_api(url, method='get', data=None):
62-
if method.lower() == 'get':
63-
return requests.get(url)
64-
elif method.lower() == 'post':
65-
return requests.post(url, json=data)
66-
else:
67-
raise ValueError("Unsupported HTTP method")
61+
print("Hello, World!")
6862
6963
anthropic_malicious_package_question:
7064
name: Anthropic Malicious Package

tests/integration/ollama/testcases.yaml

+2-5
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,10 @@ testcases:
5555
],
5656
"num_ctx": 8096
5757
},
58-
"prompt":"<|fim_prefix|>\n# codegate/test.py\nimport invokehttp\nimport requests\n\nkey = \"mysecret-key\"\n\ndef call_api():\n <|fim_suffix|>\n\n\ndata = {'key1': 'test1', 'key2': 'test2'}\nresponse = call_api('http://localhost:8080', method='post', data='data')\n<|fim_middle|>"
58+
"prompt":"# ***Do not add code comments!***\n***Do not add anything else besides the body of the function!***\n<|fim_prefix|>def print_hello_world():\n <|fim_suffix|>\n\n\nprint_hello_world()\n<|fim_middle|>"
5959
}
6060
likes: |
61-
```python
62-
if __name__ == '__main__':
63-
invokehttp.run(call_api)
64-
```
61+
print("Hello, World!")
6562
6663
ollama_malicious_package_question:
6764
name: Ollama Malicious Package

tests/integration/vllm/testcases.yaml

+2-9
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,10 @@ testcases:
5151
"#- coding: utf-8",
5252
"```"
5353
],
54-
"prompt":"<|fim_prefix|>\n# codegate/test.py\nimport invokehttp\nimport requests\n\nkey = \"mysecret-key\"\n\ndef call_api():\n <|fim_suffix|>\n\n\ndata = {'key1': 'test1', 'key2': 'test2'}\nresponse = call_api('http://localhost:8080', method='post', data='data')\n<|fim_middle|>"
54+
"prompt":"# Do not add comments\n<|fim_prefix|>\n# codegate/greet.py\ndef print_hello():\n <|fim_suffix|>\n\n\nprint_hello()\n<|fim_middle|>"
5555
}
5656
likes: |
57-
return response.json()
58-
59-
def test_call_api():
60-
response = call_api('http://localhost:8080', method='post', data='data')
61-
assert response['key1'] == 'test1' and response['key2'] == 'test2', "Test failed"
62-
63-
if __name__ == '__main__':
64-
test_call_api()
57+
print("Hello, World!")
6558
6659
vllm_malicious_package_question:
6760
name: VLLM Malicious Package

0 commit comments

Comments
 (0)