Skip to content

Commit c18eede

Browse files
flask-migration-complete (#486)
Summary: - Replace all `java` `mockserver` mocks with `flask` mocking apps. - Update documentation. - Update CICD. - All robot tests pass.
1 parent 67f3a90 commit c18eede

File tree

61 files changed

+6129
-4688
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+6129
-4688
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,6 @@ jobs:
152152
if: success()
153153
run: python cicd/python/build.py --verbose --test
154154

155-
- name: Mock Server Download
156-
run: |
157-
mvn org.apache.maven.plugins:maven-dependency-plugin:3.0.2:copy `
158-
'-Dartifact=org.mock-server:mockserver-netty:5.12.0:jar:shaded' `
159-
'-DoutputDirectory=test/downloads'
160-
161155
- name: Create certificates for robot tests
162156
run: |
163157
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
@@ -360,13 +354,6 @@ jobs:
360354
exit 1
361355
fi
362356
363-
- name: Mock Server Download
364-
run: |
365-
mvn \
366-
org.apache.maven.plugins:maven-dependency-plugin:3.0.2:copy \
367-
-Dartifact=org.mock-server:mockserver-netty:5.12.0:jar:shaded \
368-
-DoutputDirectory=test/downloads
369-
370357
- name: Create certificates for robot tests
371358
run: |
372359
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
@@ -509,9 +496,7 @@ jobs:
509496
sudo apt-get install --yes build-essential
510497
sudo apt-get install --yes --no-install-recommends postgresql-client
511498
gccVersion="$(gcc --version 2>&1 | head -n 1)"
512-
javaVersion="$(java -version 2>&1 | head -n 1)"
513499
echo "gcc version: ${gccVersion}"
514-
echo "java version: ${javaVersion}"
515500
516501
- name: Install Python dependencies
517502
run: |
@@ -625,13 +610,6 @@ jobs:
625610
exit 1
626611
fi
627612
628-
- name: Mock Server Download
629-
run: |
630-
mvn \
631-
org.apache.maven.plugins:maven-dependency-plugin:3.0.2:copy \
632-
-Dartifact=org.mock-server:mockserver-netty:5.12.0:jar:shaded \
633-
-DoutputDirectory=test/downloads
634-
635613
- name: Create certificates for robot tests
636614
run: |
637615
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
@@ -789,8 +767,6 @@ jobs:
789767
uses: Vampire/setup-wsl@v3.0.0
790768
with:
791769
additional-packages:
792-
maven
793-
openjdk-11-jre
794770
openssl
795771
postgresql
796772
python3
@@ -814,14 +790,6 @@ jobs:
814790
name: Generate rewritten registry for simulations
815791
run: python3 test/python/registry-rewrite.py
816792

817-
- shell: wsl-bash {0}
818-
name: Mock Server Download
819-
run: |
820-
mvn \
821-
org.apache.maven.plugins:maven-dependency-plugin:3.0.2:copy \
822-
-Dartifact=org.mock-server:mockserver-netty:5.12.0:jar:shaded \
823-
-DoutputDirectory=test/downloads
824-
825793
- shell: wsl-bash {0}
826794
name: Create certificates for robot tests
827795
run: |
@@ -890,9 +858,6 @@ jobs:
890858
- name: Check out code into the Go module directory
891859
uses: actions/checkout@v4.1.1
892860

893-
- name: Set env # awful hack to get java 8 and support the abomnible mock server template grammar
894-
run: echo "JAVA_HOME=${JAVA_HOME_8_X64}" >> "$GITHUB_ENV"
895-
896861
- name: Set up Go 1.x
897862
uses: actions/setup-go@v5.0.0
898863
with:
@@ -975,13 +940,6 @@ jobs:
975940
if: success()
976941
run: python cicd/python/build.py --verbose --test
977942

978-
- name: Mock Server Download
979-
run: |
980-
mvn \
981-
org.apache.maven.plugins:maven-dependency-plugin:3.0.2:copy \
982-
-Dartifact=org.mock-server:mockserver-netty:5.12.0:jar:shaded \
983-
-DoutputDirectory=test/downloads
984-
985943
- name: Create certificates for robot tests
986944
run: |
987945
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
@@ -1220,13 +1178,6 @@ jobs:
12201178
load: true
12211179
tags: stackql/stackql:${{github.sha}},stackql/stackql:v${{env.BUILDMAJORVERSION}}.${{env.BUILDMINORVERSION}}.${{env.BUILDPATCHVERSION}},stackql/stackql:latest
12221180

1223-
- name: Mock Server Download
1224-
run: |
1225-
mvn \
1226-
org.apache.maven.plugins:maven-dependency-plugin:3.0.2:copy \
1227-
-Dartifact=org.mock-server:mockserver-netty:5.12.0:jar:shaded \
1228-
-DoutputDirectory=test/downloads
1229-
12301181
- name: Debug info
12311182
run: |
12321183
echo "psql version info: $(psql --version)"

Dockerfile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,9 @@ ENV TEST_ROOT_DIR=${TEST_ROOT_DIR}
6666

6767
RUN apt-get update \
6868
&& apt-get install --yes --no-install-recommends \
69-
default-jdk \
70-
default-jre \
71-
maven \
7269
openssl \
7370
postgresql-client \
74-
sqlite3 \
75-
&& pip3 install PyYaml robotframework psycopg2-binary "psycopg[binary]" sqlalchemy \
76-
&& mvn \
77-
org.apache.maven.plugins:maven-dependency-plugin:3.0.2:copy \
78-
-Dartifact=org.mock-server:mockserver-netty:5.12.0:jar:shaded \
79-
-DoutputDirectory=${TEST_ROOT_DIR}/test/downloads
71+
sqlite3
8072

8173
FROM utility AS certificates
8274

@@ -104,9 +96,11 @@ ENV TEST_ROOT_DIR=${TEST_ROOT_DIR}
10496

10597
RUN mkdir -p ${TEST_ROOT_DIR}
10698

99+
ADD cicd ${TEST_ROOT_DIR}/cicd
100+
107101
COPY --from=certificates /opt/test/stackql ${TEST_ROOT_DIR}/
108102

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

112106
FROM utility AS integration

docker-compose.yml

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -106,74 +106,7 @@ services:
106106
- bash
107107
- -c
108108
- |
109-
MOCKSERVER_JAR='/opt/test/stackql/test/downloads/mockserver-netty-5.12.0-shaded.jar'
110-
JSON_INIT_FILE_DIR='/opt/test/stackql/test/mockserver/expectations'
111-
java -Dfile.encoding=UTF-8 \
112-
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-gcp-expectations.json \
113-
-Dmockserver.logLevel=OFF \
114-
-Droot.logLevel=OFF \
115-
-jar $${MOCKSERVER_JAR} \
116-
-serverPort $${MOCKSERVER_PORT_GOOGLE}&
117-
java -Dfile.encoding=UTF-8 \
118-
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-github-expectations.json \
119-
-Dmockserver.logLevel=OFF \
120-
-Droot.logLevel=OFF \
121-
-jar $${MOCKSERVER_JAR} \
122-
-serverPort $${MOCKSERVER_PORT_GITHUB}&
123-
java -Dfile.encoding=UTF-8 \
124-
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-aws-expectations.json \
125-
-Dmockserver.logLevel=OFF \
126-
-Droot.logLevel=OFF \
127-
-jar $${MOCKSERVER_JAR} \
128-
-serverPort $${MOCKSERVER_PORT_AWS}&
129-
java -Dfile.encoding=UTF-8 \
130-
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-k8s-expectations.json \
131-
-Dmockserver.logLevel=OFF \
132-
-Droot.logLevel=OFF \
133-
-jar $${MOCKSERVER_JAR} \
134-
-serverPort $${MOCKSERVER_PORT_K8S}&
135-
java -Dfile.encoding=UTF-8 \
136-
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-registry-expectations.json \
137-
-Dmockserver.logLevel=OFF \
138-
-Droot.logLevel=OFF \
139-
-jar $${MOCKSERVER_JAR} \
140-
-serverPort $${MOCKSERVER_PORT_REGISTRY}&
141-
java -Dfile.encoding=UTF-8 \
142-
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-okta-expectations.json \
143-
-Dmockserver.logLevel=OFF \
144-
-Droot.logLevel=OFF \
145-
-jar $${MOCKSERVER_JAR} \
146-
-serverPort $${MOCKSERVER_PORT_OKTA}&
147-
java -Dfile.encoding=UTF-8 \
148-
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-sumologic-expectations.json \
149-
-Dmockserver.logLevel=OFF \
150-
-Droot.logLevel=OFF \
151-
-jar $${MOCKSERVER_JAR} \
152-
-serverPort $${MOCKSERVER_PORT_SUMOLOGIC}&
153-
java -Dfile.encoding=UTF-8 \
154-
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-digitalocean-expectations.json \
155-
-Dmockserver.logLevel=OFF \
156-
-Droot.logLevel=OFF \
157-
-jar $${MOCKSERVER_JAR} \
158-
-serverPort $${MOCKSERVER_PORT_DIGITALOCEAN}&
159-
java -Dfile.encoding=UTF-8 \
160-
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-azure-expectations.json \
161-
-Dmockserver.logLevel=OFF \
162-
-Droot.logLevel=OFF \
163-
-jar $${MOCKSERVER_JAR} \
164-
-serverPort $${MOCKSERVER_PORT_AZURE}&
165-
java -Dfile.encoding=UTF-8 \
166-
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-google-admin-expectations.json \
167-
-Dmockserver.logLevel=OFF \
168-
-Droot.logLevel=OFF \
169-
-jar $${MOCKSERVER_JAR} \
170-
-serverPort $${MOCKSERVER_PORT_GOOGLEADMIN}&
171-
java -Dfile.encoding=UTF-8 \
172-
-Dmockserver.initializationJsonPath=$${JSON_INIT_FILE_DIR}/static-auth-testing-expectations.json \
173-
-Dmockserver.logLevel=OFF \
174-
-Droot.logLevel=OFF \
175-
-jar $${MOCKSERVER_JAR} \
176-
-serverPort $${MOCKSERVER_PORT_STACKQL_AUTH_TESTING}
109+
echo "TODO: Implement containerised mock server"
177110
postgres_stackql:
178111
image: postgres:14.5-bullseye
179112
hostname: postgres_stackql

docs/developer_guide.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ For serious development, simulated integration tests are essential. So, there a
2727

2828
- Install the python dependencies (including `robot` framework). Simplest way, system permitting, is `pip install -r cicd/requirements.txt`.
2929
- 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/).
30-
- Install `java`. Version `11` is what is currently used in CI but this ought not to be mandatory.
31-
- 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).
3230

3331
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):
3432
- Run mocked functional tests: `python cicd/python/build.py --robot-test`. This will subject the executable to the automated testing regimen.

test/mockserver/README.md

Lines changed: 0 additions & 105 deletions
This file was deleted.

0 commit comments

Comments
 (0)