Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 0 additions & 49 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,6 @@ jobs:
if: success()
run: python cicd/python/build.py --verbose --test

- name: Mock Server Download
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
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
Expand Down Expand Up @@ -360,13 +354,6 @@ jobs:
exit 1
fi

- name: Mock Server Download
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
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
Expand Down Expand Up @@ -509,9 +496,7 @@ jobs:
sudo apt-get install --yes build-essential
sudo apt-get install --yes --no-install-recommends postgresql-client
gccVersion="$(gcc --version 2>&1 | head -n 1)"
javaVersion="$(java -version 2>&1 | head -n 1)"
echo "gcc version: ${gccVersion}"
echo "java version: ${javaVersion}"

- name: Install Python dependencies
run: |
Expand Down Expand Up @@ -625,13 +610,6 @@ jobs:
exit 1
fi

- name: Mock Server Download
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
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
Expand Down Expand Up @@ -789,8 +767,6 @@ jobs:
uses: Vampire/setup-wsl@v3.0.0
with:
additional-packages:
maven
openjdk-11-jre
openssl
postgresql
python3
Expand All @@ -814,14 +790,6 @@ jobs:
name: Generate rewritten registry for simulations
run: python3 test/python/registry-rewrite.py

- shell: wsl-bash {0}
name: Mock Server Download
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

- shell: wsl-bash {0}
name: Create certificates for robot tests
run: |
Expand Down Expand Up @@ -890,9 +858,6 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v4.1.1

- name: Set env # awful hack to get java 8 and support the abomnible mock server template grammar
run: echo "JAVA_HOME=${JAVA_HOME_8_X64}" >> "$GITHUB_ENV"

- name: Set up Go 1.x
uses: actions/setup-go@v5.0.0
with:
Expand Down Expand Up @@ -975,13 +940,6 @@ jobs:
if: success()
run: python cicd/python/build.py --verbose --test

- name: Mock Server Download
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
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
Expand Down Expand Up @@ -1220,13 +1178,6 @@ jobs:
load: true
tags: stackql/stackql:${{github.sha}},stackql/stackql:v${{env.BUILDMAJORVERSION}}.${{env.BUILDMINORVERSION}}.${{env.BUILDPATCHVERSION}},stackql/stackql:latest

- name: Mock Server Download
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: Debug info
run: |
echo "psql version info: $(psql --version)"
Expand Down
14 changes: 4 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,9 @@ ENV TEST_ROOT_DIR=${TEST_ROOT_DIR}

RUN apt-get update \
&& apt-get install --yes --no-install-recommends \
default-jdk \
default-jre \
maven \
openssl \
postgresql-client \
sqlite3 \
&& pip3 install PyYaml robotframework psycopg2-binary "psycopg[binary]" sqlalchemy \
&& 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_ROOT_DIR}/test/downloads
sqlite3

FROM utility AS certificates

Expand Down Expand Up @@ -104,9 +96,11 @@ ENV TEST_ROOT_DIR=${TEST_ROOT_DIR}

RUN mkdir -p ${TEST_ROOT_DIR}

ADD cicd ${TEST_ROOT_DIR}/cicd

COPY --from=certificates /opt/test/stackql ${TEST_ROOT_DIR}/

RUN pip3 install PyYaml \
RUN pip3 install -r ${TEST_ROOT_DIR}/cicd/requirements.txt \
&& python3 ${TEST_ROOT_DIR}/test/python/registry-rewrite.py

FROM utility AS integration
Expand Down
69 changes: 1 addition & 68 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,74 +106,7 @@ services:
- bash
- -c
- |
MOCKSERVER_JAR='/opt/test/stackql/test/downloads/mockserver-netty-5.12.0-shaded.jar'
JSON_INIT_FILE_DIR='/opt/test/stackql/test/mockserver/expectations'
java -Dfile.encoding=UTF-8 \
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-gcp-expectations.json \
-Dmockserver.logLevel=OFF \
-Droot.logLevel=OFF \
-jar $${MOCKSERVER_JAR} \
-serverPort $${MOCKSERVER_PORT_GOOGLE}&
java -Dfile.encoding=UTF-8 \
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-github-expectations.json \
-Dmockserver.logLevel=OFF \
-Droot.logLevel=OFF \
-jar $${MOCKSERVER_JAR} \
-serverPort $${MOCKSERVER_PORT_GITHUB}&
java -Dfile.encoding=UTF-8 \
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-aws-expectations.json \
-Dmockserver.logLevel=OFF \
-Droot.logLevel=OFF \
-jar $${MOCKSERVER_JAR} \
-serverPort $${MOCKSERVER_PORT_AWS}&
java -Dfile.encoding=UTF-8 \
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-k8s-expectations.json \
-Dmockserver.logLevel=OFF \
-Droot.logLevel=OFF \
-jar $${MOCKSERVER_JAR} \
-serverPort $${MOCKSERVER_PORT_K8S}&
java -Dfile.encoding=UTF-8 \
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-registry-expectations.json \
-Dmockserver.logLevel=OFF \
-Droot.logLevel=OFF \
-jar $${MOCKSERVER_JAR} \
-serverPort $${MOCKSERVER_PORT_REGISTRY}&
java -Dfile.encoding=UTF-8 \
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-okta-expectations.json \
-Dmockserver.logLevel=OFF \
-Droot.logLevel=OFF \
-jar $${MOCKSERVER_JAR} \
-serverPort $${MOCKSERVER_PORT_OKTA}&
java -Dfile.encoding=UTF-8 \
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-sumologic-expectations.json \
-Dmockserver.logLevel=OFF \
-Droot.logLevel=OFF \
-jar $${MOCKSERVER_JAR} \
-serverPort $${MOCKSERVER_PORT_SUMOLOGIC}&
java -Dfile.encoding=UTF-8 \
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-digitalocean-expectations.json \
-Dmockserver.logLevel=OFF \
-Droot.logLevel=OFF \
-jar $${MOCKSERVER_JAR} \
-serverPort $${MOCKSERVER_PORT_DIGITALOCEAN}&
java -Dfile.encoding=UTF-8 \
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-azure-expectations.json \
-Dmockserver.logLevel=OFF \
-Droot.logLevel=OFF \
-jar $${MOCKSERVER_JAR} \
-serverPort $${MOCKSERVER_PORT_AZURE}&
java -Dfile.encoding=UTF-8 \
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-google-admin-expectations.json \
-Dmockserver.logLevel=OFF \
-Droot.logLevel=OFF \
-jar $${MOCKSERVER_JAR} \
-serverPort $${MOCKSERVER_PORT_GOOGLEADMIN}&
java -Dfile.encoding=UTF-8 \
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-auth-testing-expectations.json \
-Dmockserver.logLevel=OFF \
-Droot.logLevel=OFF \
-jar $${MOCKSERVER_JAR} \
-serverPort $${MOCKSERVER_PORT_STACKQL_AUTH_TESTING}
echo "TODO: Implement containerised mock server"
postgres_stackql:
image: postgres:14.5-bullseye
hostname: postgres_stackql
Expand Down
2 changes: 0 additions & 2 deletions docs/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ For serious development, simulated integration tests are essential. So, there a

- Install the python dependencies (including `robot` framework). Simplest way, system permitting, is `pip install -r cicd/requirements.txt`.
- Install `psql`. On some systems, this can be done as client only and/or with various package managers; fallback is to just [install postgres manually](https://www.postgresql.org/download/).
- Install `java`. Version `11` is what is currently used in CI but this ought not to be mandatory.
- Install `mock-server`, either using a package manager (eg `maven`), or from source per [the mockserver docs](https://www.mock-server.com/mock_server/running_mock_server.html#build-and-run-from-source).

Having installed all dependencies, the `robot` tests should be run from the repository root directory (this relies upon the executable in `./build/stackql`, built above):
- Run mocked functional tests: `python cicd/python/build.py --robot-test`. This will subject the executable to the automated testing regimen.
Expand Down
105 changes: 0 additions & 105 deletions test/mockserver/README.md

This file was deleted.

Loading