Skip to content

Commit

Permalink
merge from main
Browse files Browse the repository at this point in the history
Signed-off-by: Yash Khare <[email protected]>
  • Loading branch information
khareyash05 committed Sep 9, 2024
1 parent c017be3 commit a92cedb
Show file tree
Hide file tree
Showing 8 changed files with 564 additions and 73 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"preLaunchTask": "${defaultBuildTask}"
}
]
}
}
183 changes: 181 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 18 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "keployio",
"displayName": "Keploy",
"description": "Streamline testing with the power of Keploy, directly in your favorite IDE.",
"version": "1.0.7",
"version": "1.0.6",
"publisher": "Keploy",
"icon": "media/logo.png",
"pricing": "Free",
Expand All @@ -21,7 +21,8 @@
],
"activationEvents": [
"onCommand:keploy.utg",
"onLanguage:javascript"
"onLanguage:javascript",
"onUri:keploy.handleUri"
],
"main": "./out/extension.js",
"contributes": {
Expand Down Expand Up @@ -81,6 +82,11 @@
"group": "navigation",
"when": "keploy.signedIn != true && view == Keploy-Sidebar"
},
{
"command": "keploy.SignInWithOthers",
"group": "navigation",
"when": "keploy.signedIn != true && view == Keploy-Sidebar"
},
{
"command": "keploy.SignOut",
"group": "navigation",
Expand All @@ -94,6 +100,11 @@
"title": "Sign In",
"when": "keploy.signedIn != true && view == Keploy-Sidebar"
},
{
"command": "keploy.SignInWithOthers",
"title": "Sign In With Others",
"when": "keploy.signedIn != true && view == Keploy-Sidebar"
},
{
"command": "keploy.SignOut",
"title": "Sign Out",
Expand Down Expand Up @@ -205,6 +216,11 @@
"js-yaml": "^4.1.0",
"sinon": "^17.0.1",
"svelte": "^4.2.12",
"tree-sitter": "^0.21.1",
"tree-sitter-java": "^0.21.0",
"tree-sitter-go": "^0.23.0",
"tree-sitter-javascript": "^0.21.4",
"tree-sitter-python": "^0.21.0",
"uuid": "^10.0.0",
"walk": "^2.3.15",
"yaml": "^2.4.2"
Expand Down
46 changes: 37 additions & 9 deletions scripts/utg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,46 @@ export API_KEY="1234"

sourceFilePath=$1
testFilePath=$2
coverageReportPath=$3
command=$4


# Add env variables to the npm test command
# utgEnv=" -- --coverage --coverageReporters=text --coverageReporters=cobertura --coverageDirectory=./coverage"
# Get the file extension
extension="${sourceFilePath##*.}"

# testCommand="npm test "+ $utgEnv
# If the file is a Python file, install pytest-cov
if [ "$extension" = "py" ]; then
echo "Installing pytest-cov..."
pip3 install pytest-cov --break-system-packages
fi

if [ "$extension" = "go" ]; then
echo "Installing Go coverage tools..."
go install github.com/axw/gocov/[email protected]
go install github.com/AlekSi/[email protected]
export PATH=$PATH:$(go env GOPATH)/bin
fi

keploy gen --source-file-path="$sourceFilePath" \
--test-file-path="$testFilePath" \
--test-command="npm test -- --coverage --coverageReporters=text --coverageReporters=cobertura --coverageDirectory=./coverage
" \
--coverage-report-path="./coverage/cobertura-coverage.xml"\
--llmApiVersion "2024-02-01" --llmBaseUrl "https://api.keploy.io" --max-iterations "10"
# Add env variables to the npm test command
# utgEnv=" -- --coverage --coverageReporters=text --coverageReporters=cobertura --coverageDirectory=./coverage"

# Construct the keploy gen command
if [ "$extension" = "java" ]; then
keploy gen --source-file-path="$sourceFilePath" \
--test-file-path="$testFilePath" \
--test-command="$command" \
--coverage-report-path="$coverageReportPath" \
--llmApiVersion "2024-02-01" \
--llmBaseUrl "https://api.keploy.io" \
--max-iterations "10" \
--coverageFormat jacoco
else
keploy gen --source-file-path="$sourceFilePath" \
--test-file-path="$testFilePath" \
--test-command="$command" \
--coverage-report-path="$coverageReportPath" \
--llmApiVersion "2024-02-01" \
--llmBaseUrl "https://api.keploy.io" \
--max-iterations "10" \
--coverageFormat cobertura
fi
2 changes: 1 addition & 1 deletion src/OneClickInstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { exec } from 'child_process';
export default function executeKeployOneClickCommand(): void {
// check before if keploy has been installed first
const checkKeployExistsCommand = `keploy`;
const installationCommand = `curl--silent - O - L https://keploy.io/install.sh && bash install.sh`;
const installationCommand = `curl --silent -O -L https://keploy.io/install.sh && bash install.sh`;

exec(checkKeployExistsCommand, (error, stdout, stderr) => {
if (error) {
Expand Down
Loading

0 comments on commit a92cedb

Please sign in to comment.