Skip to content

Commit

Permalink
restore-windows-ci (#429)
Browse files Browse the repository at this point in the history
Summary:

- Restore long term inactive and bug-ridden `windows` CI.
- `openssl` version pinning for `windows`.
  • Loading branch information
general-kroll-4-life committed Jun 17, 2024
1 parent 336c2e8 commit 7c79a31
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v5.0.0
with:
go-version: ^1.19
go-version: ^1.21
check-latest: true
cache: true
id: go
Expand Down Expand Up @@ -90,13 +90,18 @@ jobs:
echo "SOURCE_BRANCH=${GITHUB_REF#refs/heads/}"
echo "SOURCE_TAG=${GITHUB_REF#refs/tags/}"
} >> "${GITHUB_STATE}"
- name: Choco install openssl
uses: crazy-max/ghaction-chocolatey@v3.0.0
timeout-minutes: 40
with:
args: "install --force openssl --version 3.1.1"

- name: Choco install packages
uses: crazy-max/ghaction-chocolatey@v3.0.0
if: startsWith(steps.git_ref_parse.outputs.SOURCE_TAG, 'build-release')
timeout-minutes: 40
with:
args: "install --force postgresql13 openssl sqlite"
args: "install --force postgresql13 sqlite"

- name: Install Python dependencies
run: |
Expand Down Expand Up @@ -147,34 +152,31 @@ jobs:
run: python cicd/python/build.py --verbose --test

- name: Mock Server Download
if: startsWith(steps.git_ref_parse.outputs.SOURCE_TAG, 'build-release')
run: |
mvn org.apache.maven.plugins:maven-dependency-plugin:3.0.2:copy `
'-Dartifact=org.mock-server:mockserver-netty:5.12.0:jar:shaded' `
'-DoutputDirectory=test/downloads'
- name: Create certificates for robot tests
if: startsWith(steps.git_ref_parse.outputs.SOURCE_TAG, 'build-release')
run: |
openssl req -x509 -keyout test/server/mtls/credentials/pg_server_key.pem -out test/server/mtls/credentials/pg_server_cert.pem -config test/server/mtls/openssl.cnf -days 365
openssl req -x509 -keyout test/server/mtls/credentials/pg_client_key.pem -out test/server/mtls/credentials/pg_client_cert.pem -config test/server/mtls/openssl.cnf -days 365
openssl req -x509 -keyout test/server/mtls/credentials/pg_rubbish_key.pem -out test/server/mtls/credentials/pg_rubbish_cert.pem -config test/server/mtls/openssl.cnf -days 365
- name: Run robot mocked functional tests
if: startsWith(steps.git_ref_parse.outputs.SOURCE_TAG, 'build-release')
env:
PSQL_EXE: C:\Program Files\PostgreSQL\13\bin\psql
SQLITE_EXE: C:\ProgramData\chocolatey\lib\SQLite\tools\sqlite3.exe
run: |
python cicd/python/build.py --robot-test
- name: Output from mocked functional tests
if: startsWith(steps.git_ref_parse.outputs.SOURCE_TAG, 'build-release')
if: always()
run: |
cat ./test/robot/functional/output.xml
cat ./test/robot/functional/output.xml || echo "no functional test output present"
- name: Run robot integration tests
if: env.AZURE_CLIENT_SECRET != '' && startsWith(steps.git_ref_parse.outputs.SOURCE_TAG, 'build-release')
if: env.AZURE_CLIENT_SECRET != '' && startsWith(env.STATE_SOURCE_TAG, 'build-release')
env:
PSQL_EXE: C:\Program Files\PostgreSQL\13\bin\psql
SQLITE_EXE: C:\ProgramData\chocolatey\lib\SQLite\tools\sqlite3.exe
Expand Down Expand Up @@ -212,7 +214,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v5.0.0
with:
go-version: ^1.19
go-version: ^1.21
check-latest: true
cache: true
id: go
Expand Down Expand Up @@ -390,7 +392,7 @@ jobs:
cat ./test/robot/functional/output.xml
- name: Run robot integration tests
if: env.AZURE_CLIENT_SECRET != '' && startsWith(steps.git_ref_parse.outputs.SOURCE_TAG, 'build-release')
if: env.AZURE_CLIENT_SECRET != '' && startsWith(env.STATE_SOURCE_TAG, 'build-release')
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
Expand Down Expand Up @@ -541,7 +543,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v5.0.0
with:
go-version: ^1.19
go-version: ^1.21
check-latest: true
cache: true
id: go
Expand Down Expand Up @@ -643,7 +645,7 @@ jobs:
cat ./test/robot/functional/output.xml
- name: Run robot integration tests
if: env.AZURE_CLIENT_SECRET != '' && startsWith(steps.git_ref_parse.outputs.SOURCE_TAG, 'build-release')
if: env.AZURE_CLIENT_SECRET != '' && startsWith(env.STATE_SOURCE_TAG, 'build-release')
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
Expand Down Expand Up @@ -686,7 +688,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v5.0.0
with:
go-version: ^1.19
go-version: ^1.21
check-latest: true
cache: true
id: go
Expand Down Expand Up @@ -928,7 +930,7 @@ jobs:
cat ./test/robot/functional/output.xml
- name: Run robot integration tests
if: env.AZURE_CLIENT_SECRET != '' && startsWith(steps.git_ref_parse.outputs.SOURCE_TAG, 'build-release')
if: env.AZURE_CLIENT_SECRET != '' && startsWith(env.STATE_SOURCE_TAG, 'build-release')
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
Expand Down
4 changes: 2 additions & 2 deletions test/robot/lib/stackql_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def get_analytics_db_init_path(sql_backend_str :str) -> str:

def get_sqlite_export_db_path(execution_env :str) -> str:
if execution_env == 'native':
return os.path.abspath(os.path.join(REPOSITORY_ROOT, "test", "db", "tmp", "export_testing.sqlite"))
return get_unix_path(os.path.abspath(os.path.join(REPOSITORY_ROOT, "test", "db", "tmp", "export_testing.sqlite")))
if execution_env == 'docker':
return get_unix_path(os.path.join('/opt', 'stackql', "test", "export_testing.sqlite"))

Expand Down Expand Up @@ -565,7 +565,7 @@ def get_registry_cfg(url :str, local_root :str, nop_verify :bool) -> dict:
PSQL_MTLS_CONN_STR :str = f"host={PSQL_CLIENT_HOST} port={PG_SRV_PORT_MTLS} user=myuser sslmode=verify-full sslcert={STACKQL_PG_CLIENT_CERT_PATH} sslkey={STACKQL_PG_CLIENT_KEY_PATH} sslrootcert={STACKQL_PG_SERVER_CERT_PATH} dbname=mydatabase"
PSQL_MTLS_CONN_STR_UNIX :str = f"host={PSQL_CLIENT_HOST} port={PG_SRV_PORT_MTLS} user=myuser sslmode=verify-full sslcert={STACKQL_PG_CLIENT_CERT_PATH_UNIX} sslkey={STACKQL_PG_CLIENT_KEY_PATH_UNIX} sslrootcert={STACKQL_PG_SERVER_CERT_PATH_UNIX} dbname=mydatabase"

PSQL_MTLS_CONN_STR_EXPORT_UNIX :str = f"host={PSQL_CLIENT_HOST} port={PG_SRV_PORT_MTLS_EXPORT} user=myuser sslmode=verify-full sslcert={STACKQL_PG_CLIENT_CERT_PATH_UNIX} sslkey={STACKQL_PG_CLIENT_KEY_PATH_UNIX} sslrootcert={STACKQL_PG_SERVER_CERT_PATH_UNIX} dbname=mydatabase"
PSQL_MTLS_CONN_STR_EXPORT_UNIX :str = f"host={PSQL_CLIENT_HOST} port={PG_SRV_PORT_MTLS_EXPORT} user=myuser sslmode=verify-full sslcert={STACKQL_PG_CLIENT_CERT_PATH_UNIX} sslkey={STACKQL_PG_CLIENT_KEY_PATH_UNIX} sslrootcert={STACKQL_PG_SERVER_CERT_PATH_UNIX} dbname=mydatabase".replace('\\', '/')

PSQL_MTLS_DISABLE_CONN_STR :str = f"host={PSQL_CLIENT_HOST} port={PG_SRV_PORT_MTLS} user=myuser sslmode=disable sslcert={STACKQL_PG_CLIENT_CERT_PATH} sslkey={STACKQL_PG_CLIENT_KEY_PATH} sslrootcert={STACKQL_PG_SERVER_CERT_PATH} dbname=mydatabase"
PSQL_MTLS_DISABLE_CONN_STR_UNIX :str = f"host={PSQL_CLIENT_HOST} port={PG_SRV_PORT_MTLS} user=myuser sslmode=disable sslcert={STACKQL_PG_CLIENT_CERT_PATH_UNIX} sslkey={STACKQL_PG_CLIENT_KEY_PATH_UNIX} sslrootcert={STACKQL_PG_SERVER_CERT_PATH_UNIX} dbname=mydatabase"
Expand Down

0 comments on commit 7c79a31

Please sign in to comment.