Skip to content

Commit

Permalink
Corrected suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ritvik Raj committed Dec 9, 2018
1 parent cef1777 commit 4cff223
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
17 changes: 11 additions & 6 deletions build/ci/addEnvPath.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@

import json,sys
import os.path
key = sys.argv[1]
jsonPath = sys.argv[1]
key = sys.argv[2]

if os.path.isfile('$(ENV_PATHS_LOCATION)'):
with open('$(ENV_PATHS_LOCATION)', 'r') as read_file:
if os.path.isfile(jsonPath):
with open(jsonPath, 'r') as read_file:
data = json.load(read_file)
else:
with open('$(ENV_PATHS_LOCATION)', 'w+') as read_file:
data = {}
with open('$(ENV_PATHS_LOCATION)', 'w') as outfile:
directory = os.path.dirname(jsonPath)
if not os.path.exists(directory):
os.makedirs(directory)
with open(jsonPath, 'w+') as read_file:
data = {}
data = {}
with open(jsonPath, 'w') as outfile:
data[key] = sys.executable
json.dump(data, outfile, sort_keys=True, indent=4)
8 changes: 4 additions & 4 deletions build/ci/templates/virtual_env_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
- bash: |
pip install pipenv
pipenv run python ./build/ci/addEnvPath.py pipenvPath
pipenv run python ./build/ci/addEnvPath.py $(ENV_PATHS_LOCATION) pipenvPath
cat $(ENV_PATHS_LOCATION)
Expand All @@ -96,7 +96,7 @@ jobs:
- bash: |
python -m venv .venv
.venv/$(environmentExecutableFolder)/python ./build/ci/addEnvPath.py venvPath
.venv/$(environmentExecutableFolder)/python ./build/ci/addEnvPath.py $(ENV_PATHS_LOCATION) venvPath
cat $(ENV_PATHS_LOCATION)
Expand All @@ -108,7 +108,7 @@ jobs:
python -m virtualenv .virtualenv
.virtualenv/$(environmentExecutableFolder)/python ./build/ci/addEnvPath.py virtualEnvPath
.virtualenv/$(environmentExecutableFolder)/python ./build/ci/addEnvPath.py $(ENV_PATHS_LOCATION) virtualEnvPath
cat $(ENV_PATHS_LOCATION)
Expand All @@ -122,7 +122,7 @@ jobs:


# - bash: |
# python ./build/ci/addEnvPath.py conda
# python ./build/ci/addEnvPath.py $(ENV_PATHS_LOCATION) condaPath

# source deactivate

Expand Down
2 changes: 1 addition & 1 deletion build/ci/vscode-python-pr-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
PoolName: 'Hosted VS2017'
EnvironmentExecutableFolder: 'Scripts'
ENV_PATHS_LOCATION: './src/tmp/envPaths.json'
TEST_FILES_SUFFIX: 'testvirtualenvs.ts'
TEST_FILES_SUFFIX: 'testvirtualenvs'
TestSuiteName: 'testSingleWorkspace'


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { initialize, initializeTest } from '../../../initialize';
suite('Activation of Environments in Terminal', () => {
const file = path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'src', 'testMultiRootWkspc', 'smokeTests', 'testExecInTerminal.py');
const outputFile = path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'src', 'testMultiRootWkspc', 'smokeTests', 'testExecInTerminal.log');
const envPathsLocation = ENV_PATHS_LOCATION || path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'src', 'tmp', 'envPaths.json');
const envPathsLocation = ENV_PATHS_LOCATION || path.join('.', 'src', 'tmp', 'envPaths.json');
const waitTimeForActivation = 5000;
type EnvPath = {
venvPath: string;
Expand Down
6 changes: 0 additions & 6 deletions src/tmp/envPaths.json

This file was deleted.

0 comments on commit 4cff223

Please sign in to comment.