Skip to content

Commit 15076b8

Browse files
authored
Fixes for wiremock CI (#146)
* wiremock: update lambda runtime to a supported Python * wiremock: bundle stubs locally
1 parent 298677e commit 15076b8

4 files changed

Lines changed: 1158 additions & 8 deletions

File tree

.github/workflows/wiremock.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
3838
docker pull localstack/localstack-pro &
3939
docker pull wiremock/wiremock &
40-
docker pull public.ecr.aws/lambda/python:3.9 &
40+
docker pull public.ecr.aws/lambda/python:3.12 &
4141
pip install localstack terraform-local awscli-local[ver1]
4242
4343
make install

wiremock/bin/create-stubs.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
# Import stubs into OSS WireMock (for WireMock Runner, use setup-wiremock-runner.sh)
44

5-
STUBS_URL="${STUBS_URL:-https://library.wiremock.org/catalog/api/p/personio.de/personio-de-personnel/personio.de-personnel-stubs.json}"
6-
TMP_STUBS_FILE="/tmp/personio-stubs.json"
5+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6+
STUBS_FILE="${SCRIPT_DIR}/../sample-app-oss/stubs.json"
77
WIREMOCK_URL="${WIREMOCK_URL:-http://wiremock.localhost.localstack.cloud:4566}"
88

9-
echo "Downloading stubs from ${STUBS_URL}..."
10-
curl -s -o "$TMP_STUBS_FILE" "$STUBS_URL"
11-
9+
# Note: stubs are bundled locally because library.wiremock.org now redirects to HTML
10+
# rather than serving the JSON file directly, making the remote URL unreliable.
1211
echo "Importing stubs into WireMock at ${WIREMOCK_URL}..."
13-
curl -v -X POST -H "Content-Type: application/json" --data-binary "@$TMP_STUBS_FILE" "${WIREMOCK_URL}/__admin/mappings/import"
12+
curl -v -X POST -H "Content-Type: application/json" --data-binary "@$STUBS_FILE" "${WIREMOCK_URL}/__admin/mappings/import"
1413

1514
echo ""
1615
echo "Verify stubs at: ${WIREMOCK_URL}/__admin/mappings"

wiremock/sample-app-oss/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ resource "aws_lambda_function" "hr_info_lambda" {
7878
source_code_hash = data.archive_file.lambda_zip.output_base64sha256
7979

8080
handler = "handler.get_time_off"
81-
runtime = "python3.9"
81+
runtime = "python3.12"
8282

8383
# Add a timeout for the function
8484
timeout = 10

0 commit comments

Comments
 (0)