Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests for multiple languages and the build prompt. #186

Open
wants to merge 50 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
f98d8f2
Merge branch 'plandex-ai:main' into feature/evals
ZanzyTHEbar Jun 26, 2024
33d472e
chore: Add advanced evaluation methods for test cases
ZanzyTHEbar Jun 28, 2024
203e209
chore: Update test cases with new evaluation methods
ZanzyTHEbar Jun 28, 2024
6c34630
chore: migrate tests from verify to yaml file
ZanzyTHEbar Jul 2, 2024
b7c610b
chore: Update test file paths for tests in fix directory
ZanzyTHEbar Jul 2, 2024
67798fd
chore: Update test file paths for tests in fix directory
ZanzyTHEbar Jul 2, 2024
935db3a
chore: setup multi-language tests for build dir
ZanzyTHEbar Jul 2, 2024
f91e53a
chore: begin migrating language tests to individual files
ZanzyTHEbar Jul 10, 2024
aeb4d8b
chore: continue migrating out languages tests to individual files
ZanzyTHEbar Jul 11, 2024
05424f3
chore: js and python tests
ZanzyTHEbar Jul 11, 2024
ee22522
chore: Add error handling to `processData`, update TODO comment, and …
ZanzyTHEbar Jul 11, 2024
a0e053f
chore: Add pdx line nums to tests
ZanzyTHEbar Jul 11, 2024
d0541ce
chore: cleaning up tests in build dir
ZanzyTHEbar Jul 16, 2024
6b0dfe9
chore: update md files for connection and data models
ZanzyTHEbar Jul 16, 2024
899a696
chore: update md files for network and sort function
ZanzyTHEbar Jul 16, 2024
5fbeb6f
chore: update md file user handler
ZanzyTHEbar Jul 16, 2024
5be03ff
chore: update md file user management js test
ZanzyTHEbar Jul 16, 2024
655b928
chore: Add error handling to `processData`, update TODO comment, and …
ZanzyTHEbar Jul 16, 2024
5bdb12b
chore: implement base-line asset files for fix test directory
ZanzyTHEbar Jul 19, 2024
1374559
chore: fix asset generation logic
ZanzyTHEbar Jul 19, 2024
016a87f
chore: minor updates to some of the assets
ZanzyTHEbar Jul 19, 2024
04d34ad
chore: migrate removal go assets to new file format
ZanzyTHEbar Jul 19, 2024
97782f4
chore: add assets for verify tests
ZanzyTHEbar Jul 19, 2024
407e02b
chore: finishing up verify
ZanzyTHEbar Jul 26, 2024
91c88d3
chore: split diffs and changes into separate dirs
ZanzyTHEbar Jul 29, 2024
4aa73a8
chore: finish java code for verify
ZanzyTHEbar Jul 29, 2024
8362643
chore: Refactor Java code and fix TODO comments
ZanzyTHEbar Jul 29, 2024
1c0982a
chore: finish up python code for verify test
ZanzyTHEbar Jul 29, 2024
22e2f10
chore: begin preparring to write tests
ZanzyTHEbar Jul 29, 2024
b0b9c7a
chore: begin preparring to write tests
ZanzyTHEbar Jul 29, 2024
de581c7
chore: finalizing the fix directory
ZanzyTHEbar Aug 7, 2024
24ff033
chore: finish assests for fix test dir
ZanzyTHEbar Aug 7, 2024
654ab7f
chore: Add line nums to fix post files
ZanzyTHEbar Aug 7, 2024
52f5900
chore: Add line nums to fix post files
ZanzyTHEbar Aug 7, 2024
01318c1
chore: Add line nums to fix post files
ZanzyTHEbar Aug 7, 2024
8c97e97
Merge branch 'plandex-ai:main' into feature/evals
ZanzyTHEbar Aug 7, 2024
205a32f
Merge pull request #3 from ZanzyTHEbar/feature/evals
ZanzyTHEbar Aug 7, 2024
568e717
chore: finish tests for the fix directory
ZanzyTHEbar Aug 7, 2024
54c5cfd
chore: implement the go tests for verify directory
ZanzyTHEbar Aug 7, 2024
365d310
chore: update test names to include the language identifier
ZanzyTHEbar Aug 7, 2024
f013921
chore: add all language tests for verify dir
ZanzyTHEbar Aug 7, 2024
74ef66f
chore: rename tests in fix dir to include language id
ZanzyTHEbar Aug 7, 2024
f8af6fc
chore: add js language tests to fix
ZanzyTHEbar Aug 7, 2024
5d913ea
chore: add html and java tests to fix
ZanzyTHEbar Aug 7, 2024
7842c4f
Merge pull request #4 from ZanzyTHEbar/feature/evals
ZanzyTHEbar Aug 13, 2024
eff36ce
chore: write post asset code files for build
ZanzyTHEbar Aug 15, 2024
e788158
chore: setup initial build test structure
ZanzyTHEbar Aug 15, 2024
2f94f01
Merge pull request #5 from ZanzyTHEbar/feature/evals
ZanzyTHEbar Aug 15, 2024
05f2319
chore: build tests complete
ZanzyTHEbar Aug 16, 2024
598e26b
Merge pull request #6 from ZanzyTHEbar/feature/evals
ZanzyTHEbar Aug 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions test/evals/promptfoo-poc/build/tests/connection.test.go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- description: "Verify database connection handling"
vars:
preBuildState: file://assets/go/code/connection.go
changes: file://assets/go/changes/connection.changes.md
filePath: connection.go
postBuildState: file://assets/go/code/connection.post.go
assert:
- type: is-json
- type: is-valid-openai-tools-call
- type: javascript
value: |
var args = JSON.parse(output[0].function.arguments)
return args.hasRemovedCodeErrors && args.changes.some(
change => change.hasChange and change.new.includes("func CloseConnection()")
)
15 changes: 15 additions & 0 deletions test/evals/promptfoo-poc/build/tests/data_models.test.go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- description: "Verify data models updates and relationships"
vars:
preBuildState: file://assets/go/code/data_models.go
changes: file://assets/go/changes/data_models.changes.md
filePath: data_models.go
postBuildState: file://assets/go/code/data_models.post.go
assert:
- type: is-json
- type: is-valid-openai-tools-call
- type: javascript
value: |
var args = JSON.parse(output[0].function.arguments)
return args.hasRemovedCodeErrors && args.changes.some(
change => change.hasChange and change.new.includes("Comments []*Comment")
)
15 changes: 15 additions & 0 deletions test/evals/promptfoo-poc/build/tests/data_processor.test.py.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- description: "Verify data_processor function implementation"
vars:
preBuildState: file://assets/py/code/data_processor.py
changes: file://assets/py/changes/data_processor.changes.md
filePath: data_processor.py
postBuildState: file://assets/py/code/data_processor.post.py
assert:
- type: is-json
- type: is-valid-openai-tools-call
- type: javascript
value: |
var args = JSON.parse(output[0].function.arguments)
return args.hasRemovedCodeErrors && args.changes.some(
change => change.hasChange and change.new.includes("def validateInput(input):")
)
15 changes: 15 additions & 0 deletions test/evals/promptfoo-poc/build/tests/network_config.test.go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- description: "Verify network configuration and connectivity"
vars:
preBuildState: file://assets/go/code/network_config.go
changes: file://assets/go/changes/network_config.changes.md
filePath: network_config.go
postBuildState: file://assets/go/code/network_config.post.go
assert:
- type: is-json
- type: is-valid-openai-tools-call
- type: javascript
value: |
var args = JSON.parse(output[0].function.arguments)
return args.hasRemovedCodeErrors && args.changes.some(
change => change.hasChange and change.new.includes("VerifyConnectivity()")
)
15 changes: 15 additions & 0 deletions test/evals/promptfoo-poc/build/tests/server_setup.test.go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- description: "Verify server setup and logging"
vars:
preBuildState: file://assets/go/code/server_setup.go
changes: file://assets/go/changes/server_setup.changes.md
filePath: server_setup.go
postBuildState: file://assets/go/code/server_setup.post.go
assert:
- type: is-json
- type: is-valid-openai-tools-call
- type: javascript
value: |
var args = JSON.parse(output[0].function.arguments)
return args.hasRemovedCodeErrors && args.changes.some(
change => change.hasChange and change.new.includes("log.Printf(\"Server starting at %s...")
)
15 changes: 15 additions & 0 deletions test/evals/promptfoo-poc/build/tests/sort_functions.test.go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- description: "Verify sorting logic and output"
vars:
preBuildState: file://assets/go/code/sort_functions.go
changes: file://assets/go/changes/sort_functions.changes.md
filePath: sort_functions.go
postBuildState: file://assets/go/code/sort_functions.post.go
assert:
- type: is-json
- type: is-valid-openai-tools-call
- type: javascript
value: |
var args = JSON.parse(output[0].function.arguments)
return args.hasRemovedCodeErrors && args.changes.some(
change => change.hasChange and change.new.includes("printValues(sortedValues)")
)
15 changes: 15 additions & 0 deletions test/evals/promptfoo-poc/build/tests/user_handler.test.go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- description: "Verify user handler functions for signup, login, and validation"
vars:
preBuildState: file://assets/go/code/user_handler.go
changes: file://assets/go/changes/user_handler.changes.md
filePath: user_handler.go
postBuildState: file://assets/go/code/user_handler.post.go
assert:
- type: is-json
- type: is-valid-openai-tools-call
- type: javascript
value: |
var args = JSON.parse(output[0].function.arguments)
return args.hasRemovedCodeErrors && args.changes.some(
change => change.hasChange and change.new.includes("rateLimit(\"signup\", email)")
)
15 changes: 15 additions & 0 deletions test/evals/promptfoo-poc/build/tests/user_management.test.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- description: "Verify UserManager class implementation"
vars:
preBuildState: file://assets/js/code/user_management.js
changes: file://assets/js/changes/user_management.changes.md
filePath: user_management.js
postBuildState: file://assets/js/code/user_management.post.js
assert:
- type: is-json
- type: is-valid-openai-tools-call
- type: javascript
value: |
var args = JSON.parse(output[0].function.arguments)
return args.hasRemovedCodeErrors && args.changes.some(
change => change.hasChange and change.new.includes("removeUser(username)")
)
15 changes: 15 additions & 0 deletions test/evals/promptfoo-poc/build/tests/utility_functions.test.go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- description: "Verify utility functions implementation"
vars:
preBuildState: file://assets/go/code/utility_functions.go
changes: file://assets/go/changes/utility_functions.changes.md
filePath: utility_functions.go
postBuildState: file://assets/go/code/utility_functions.post.go
assert:
- type: is-json
- type: is-valid-openai-tools-call
- type: javascript
value: |
var args = JSON.parse(output[0].function.arguments)
return args.hasRemovedCodeErrors && args.changes.some(
change => change.hasChange and change.new.includes("Multiply(a int, b int) int")
)