Skip to content

Commit

Permalink
chore:adding pytest installation and correcting github-signin
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya-eddy <[email protected]>
  • Loading branch information
Aditya-eddy committed Oct 16, 2024
1 parent 11297de commit 8c8b05a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 27 deletions.
12 changes: 12 additions & 0 deletions scripts/utg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,19 @@ extension="${sourceFilePath##*.}"

# If the file is a Python file, install pytest-cov
if [ "$extension" = "py" ]; then
echo "Checking if pytest is installed..."

# Check if pytest is installed
if ! pip3 show pytest > /dev/null 2>&1; then
echo "pytest is not installed. Installing pytest..."
pip3 install pytest --break-system-packages
else
echo "pytest is already installed."
fi

echo "Checking if pytest-cov is installed..."

# Check if pytest-cov is installed
if ! pip3 show pytest-cov > /dev/null 2>&1; then
echo "pytest-cov is not installed. Installing pytest-cov..."
pip3 install pytest-cov --break-system-packages
Expand Down
55 changes: 28 additions & 27 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,44 +556,45 @@ export function activate(context: vscode.ExtensionContext) {
} else {
vscode.commands.executeCommand('setContext', 'keploy.signedOut', true);
// Register the sign-in command if not signed in
let signInCommand = vscode.commands.registerCommand('keploy.SignInWithGithub', async () => {
try {
const result = await getGitHubAccessToken();
}
let signInCommand = vscode.commands.registerCommand('keploy.SignInWithGithub', async () => {
try {
const result = await getGitHubAccessToken();

if (result) {
const { accessToken, email } = result;
if (result) {
const { accessToken, email } = result;

getInstallationID();
getInstallationID();

// Store the access token in global state
await context.globalState.update('accessToken', accessToken);
// Store the access token in global state
await context.globalState.update('accessToken', accessToken);

const { emailID, isValid, error, JwtToken } = await validateFirst(accessToken, "https://api.keploy.io");
const { emailID, isValid, error, JwtToken } = await validateFirst(accessToken, "https://api.keploy.io");

console.log({ emailID, isValid, error, JwtToken });
console.log({ emailID, isValid, error, JwtToken });

await context.globalState.update('JwtToken', JwtToken);
await context.globalState.update('JwtToken', JwtToken);

// if (isValid) {
vscode.window.showInformationMessage('You are now signed in!');
vscode.commands.executeCommand('setContext', 'keploy.signedIn', true);
vscode.commands.executeCommand('setContext', 'keploy.signedOut', false);
// } else {
// console.log('Validation failed for the user !');
// }
// if (isValid) {
vscode.window.showInformationMessage('You are now signed in!');
vscode.commands.executeCommand('setContext', 'keploy.signedIn', true);
vscode.commands.executeCommand('setContext', 'keploy.signedOut', false);
// } else {
// console.log('Validation failed for the user !');
// }

} else {
console.log('Failed to get the session or email.');
vscode.window.showInformationMessage('Failed to sign in Keploy!');
}
} catch (error) {
// console.error('Error during sign-in:', error);
} else {
console.log('Failed to get the session or email.');
vscode.window.showInformationMessage('Failed to sign in Keploy!');
}
});
context.subscriptions.push(signInCommand);
} catch (error) {
// console.error('Error during sign-in:', error);
vscode.window.showInformationMessage('Failed to sign in Keploy!');
}
});
context.subscriptions.push(signInCommand);


}
let signInWithOthersCommand = vscode.commands.registerCommand('keploy.SignInWithOthers', async () => {
try {
await SignInWithOthers(); // The result will now be handled in the URI handler
Expand Down

0 comments on commit 8c8b05a

Please sign in to comment.