Skip to content

Commit

Permalink
Install versions of Python not available on Kokoro Python VM.
Browse files Browse the repository at this point in the history
  • Loading branch information
NickGoog committed Oct 28, 2021
1 parent 67f442a commit d7d7e38
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 48 deletions.
64 changes: 32 additions & 32 deletions test/ci/kokoro/run_integ_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,35 +101,35 @@ function update_submodules {
}


init_configs
init_python
update_submodules

set -e

# Check that we're using the correct config.
python "$GSUTIL_ENTRYPOINT" version -l
# Run integration tests.
python "$GSUTIL_ENTRYPOINT" test -p "$PROCS"
# Run custom endpoint tests.
# We don't generate a .boto for these tests since there are only a few settings.
python "$GSUTIL_ENTRYPOINT" \
-o "Credentials:gs_host=storage-psc.p.googleapis.com" \
-o "Credentials:gs_host_header=storage.googleapis.com" \
-o "Credentials:gs_json_host=storage-psc.p.googleapis.com" \
-o "Credentials:gs_json_host_header=www.googleapis.com" \
test gslib.tests.test_psc

# Run mTLS authentication test.
if [[ $API == "json" ]]; then
MTLS_TEST_ACCOUNT_REFRESH_TOKEN="/tmpfs/src/keystore/74008_mtls_test_account_refresh_token"
MTLS_TEST_ACCOUNT_CLIENT_ID="/tmpfs/src/keystore/74008_mtls_test_account_client_id"
MTLS_TEST_ACCOUNT_CLIENT_SECRET="/tmpfs/src/keystore/74008_mtls_test_account_client_secret"
MTLS_TEST_CERT_PATH="/tmpfs/src/keystore/74008_mtls_test_cert"

# Generate .boto config specifically for mTLS tests.
bash "$CFG_GENERATOR" "" "$API" "$BOTO_CONFIG" "$MTLS_TEST_ACCOUNT_REFRESH_TOKEN" "$MTLS_TEST_ACCOUNT_CLIENT_ID" "$MTLS_TEST_ACCOUNT_CLIENT_SECRET" "$MTLS_TEST_CERT_PATH"

# Run mTLS E2E test.
python "$GSUTIL_ENTRYPOINT" test gslib.tests.test_mtls.TestMtls
fi
# init_configs
# init_python
# update_submodules

# set -e

# # Check that we're using the correct config.
# python "$GSUTIL_ENTRYPOINT" version -l
# # Run integration tests.
# python "$GSUTIL_ENTRYPOINT" test -p "$PROCS"
# # Run custom endpoint tests.
# # We don't generate a .boto for these tests since there are only a few settings.
# python "$GSUTIL_ENTRYPOINT" \
# -o "Credentials:gs_host=storage-psc.p.googleapis.com" \
# -o "Credentials:gs_host_header=storage.googleapis.com" \
# -o "Credentials:gs_json_host=storage-psc.p.googleapis.com" \
# -o "Credentials:gs_json_host_header=www.googleapis.com" \
# test gslib.tests.test_psc

# # Run mTLS authentication test.
# if [[ $API == "json" ]]; then
# MTLS_TEST_ACCOUNT_REFRESH_TOKEN="/tmpfs/src/keystore/74008_mtls_test_account_refresh_token"
# MTLS_TEST_ACCOUNT_CLIENT_ID="/tmpfs/src/keystore/74008_mtls_test_account_client_id"
# MTLS_TEST_ACCOUNT_CLIENT_SECRET="/tmpfs/src/keystore/74008_mtls_test_account_client_secret"
# MTLS_TEST_CERT_PATH="/tmpfs/src/keystore/74008_mtls_test_cert"

# # Generate .boto config specifically for mTLS tests.
# bash "$CFG_GENERATOR" "" "$API" "$BOTO_CONFIG" "$MTLS_TEST_ACCOUNT_REFRESH_TOKEN" "$MTLS_TEST_ACCOUNT_CLIENT_ID" "$MTLS_TEST_ACCOUNT_CLIENT_SECRET" "$MTLS_TEST_CERT_PATH"

# # Run mTLS E2E test.
# python "$GSUTIL_ENTRYPOINT" test gslib.tests.test_mtls.TestMtls
# fi
36 changes: 20 additions & 16 deletions test/ci/kokoro/windows/run_integ_tests.bat
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ set GsutilRepoDir="T:\src\github\src\gsutil"
set "PyExePath=C:\python%PYMAJOR%%PYMINOR%\python.exe"
set "PipPath=C:\python%PYMAJOR%%PYMINOR%\Scripts\pip.exe"

if not exist %PyExePath% (
choco install python -y --version=%PYMAJOR%.%PYMINOR%.0
)

PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%GsutilRepoDir%\test\ci\kokoro\windows\config_generator.ps1' 'T:\src\keystore\74008_gsutil_kokoro_service_key' '%API%' '%BOTO_CONFIG%'"
type %BOTO_CONFIG%

Expand All @@ -30,23 +34,23 @@ git submodule update --init --recursive
rem Print config info prior to running tests
%PyExePath% %GsutilRepoDir%\gsutil.py version -l

PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%GsutilRepoDir%\test\ci\kokoro\windows\run_integ_tests.ps1' -GsutilRepoDir '%GsutilRepoDir%' -PyExe '%PyExePath%'" || exit /B 1
@REM PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%GsutilRepoDir%\test\ci\kokoro\windows\run_integ_tests.ps1' -GsutilRepoDir '%GsutilRepoDir%' -PyExe '%PyExePath%'" || exit /B 1

rem Run custom endpont tests.
rem Not enough settings to merit generating a boto config.
set PscConfig=-o "Credentials:gs_host=storage-psc.p.googleapis.com"^
-o "Credentials:gs_host_header=storage.googleapis.com"^
-o "Credentials:gs_json_host=storage-psc.p.googleapis.com"^
-o "Credentials:gs_json_host_header=www.googleapis.com"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%GsutilRepoDir%\test\ci\kokoro\windows\run_integ_tests.ps1' -GsutilRepoDir '%GsutilRepoDir%' -PyExe '%PyExePath%' -Tests 'psc' -TopLevelFlags '%PscConfig%'" || exit /B 1
@REM rem Run custom endpont tests.
@REM rem Not enough settings to merit generating a boto config.
@REM set PscConfig=-o "Credentials:gs_host=storage-psc.p.googleapis.com"^
@REM -o "Credentials:gs_host_header=storage.googleapis.com"^
@REM -o "Credentials:gs_json_host=storage-psc.p.googleapis.com"^
@REM -o "Credentials:gs_json_host_header=www.googleapis.com"
@REM PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%GsutilRepoDir%\test\ci\kokoro\windows\run_integ_tests.ps1' -GsutilRepoDir '%GsutilRepoDir%' -PyExe '%PyExePath%' -Tests 'psc' -TopLevelFlags '%PscConfig%'" || exit /B 1

rem mTLS tests only run on GCS JSON.
if not "json" == "%API%" exit /B 0
@REM rem mTLS tests only run on GCS JSON.
@REM if not "json" == "%API%" exit /B 0

set "MtlsTestAccountRefreshToken=T:\src\keystore\74008_mtls_test_account_refresh_token"
set "MtlsTestAccountClientId=T:\src\keystore\74008_mtls_test_account_client_id"
set "MtlsTestAccountClientSecret=T:\src\keystore\74008_mtls_test_account_client_secret"
set "MtlsTestCertPath=T:\src\keystore\74008_mtls_test_cert"
@REM set "MtlsTestAccountRefreshToken=T:\src\keystore\74008_mtls_test_account_refresh_token"
@REM set "MtlsTestAccountClientId=T:\src\keystore\74008_mtls_test_account_client_id"
@REM set "MtlsTestAccountClientSecret=T:\src\keystore\74008_mtls_test_account_client_secret"
@REM set "MtlsTestCertPath=T:\src\keystore\74008_mtls_test_cert"

PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%GsutilRepoDir%\test\ci\kokoro\windows\config_generator.ps1' '' '%API%' '%BOTO_CONFIG%' '%MtlsTestAccountRefreshToken%' '%MtlsTestAccountClientId%' '%MtlsTestAccountClientSecret%' '%MtlsTestCertPath%'"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%GsutilRepoDir%\test\ci\kokoro\windows\run_integ_tests.ps1' -GsutilRepoDir '%GsutilRepoDir%' -PyExe '%PyExePath%' -Tests 'mtls'"
@REM PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%GsutilRepoDir%\test\ci\kokoro\windows\config_generator.ps1' '' '%API%' '%BOTO_CONFIG%' '%MtlsTestAccountRefreshToken%' '%MtlsTestAccountClientId%' '%MtlsTestAccountClientSecret%' '%MtlsTestCertPath%'"
@REM PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%GsutilRepoDir%\test\ci\kokoro\windows\run_integ_tests.ps1' -GsutilRepoDir '%GsutilRepoDir%' -PyExe '%PyExePath%' -Tests 'mtls'"

0 comments on commit d7d7e38

Please sign in to comment.