Skip to content

Commit

Permalink
Merge pull request #21089 from mpmadhavig/master
Browse files Browse the repository at this point in the history
Fix conformance test issues
  • Loading branch information
madurangasiriwardena authored Sep 11, 2024
2 parents 629d962 + e532ffd commit 6fddd28
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 44 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/fapi-oidc-conformance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
path: './product-is'

Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:
python3 ./configure_is_fapi.py ../../$PRODUCT_IS_ZIP
- name: Set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
Expand Down Expand Up @@ -224,14 +224,14 @@ jobs:
fi
- name: Archive test results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: ./*test_results.zip

- name: Archive test logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: test-logs
Expand Down
95 changes: 59 additions & 36 deletions .github/workflows/oidc-conformance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
path: './product-is'

Expand All @@ -51,18 +51,63 @@ jobs:
pip3 install psutil
pip3 install httpx
pip3 install httplib2
- name: Download IS zip
- name: Clone conformance suite
run: |
sudo snap install jq
LATEST_RELEASE_BRANCH=$(curl -s https://gitlab.com/api/v4/projects/4175605/releases/ | jq '.[]' | jq -r '.name' | head -1)
echo ">>> Conformance suite latest release branch: $LATEST_RELEASE_BRANCH"
PROVIDED_VERSION=${{github.event.inputs.conformance-suite-version}}
if [[ -z "${PROVIDED_VERSION}" ]]; then
CONFORMANCE_SUITE_BRANCH=$LATEST_RELEASE_BRANCH
echo ">>> Conformance suite latest release branch is taken: $CONFORMANCE_SUITE_BRANCH"
else
CONFORMANCE_SUITE_BRANCH=$PROVIDED_VERSION
echo ">>> Conformance suite provided branch is taken: $CONFORMANCE_SUITE_BRANCH"
fi
echo ">>> Selected conformance suite branch: $CONFORMANCE_SUITE_BRANCH"
git clone --depth 1 --branch ${CONFORMANCE_SUITE_BRANCH} https://gitlab.com/openid/conformance-suite.git
- name: Adding extra hosts to docker-compose-dev.yml
run: sed -i '/^ volumes.*/i \ \ \ \ extra_hosts:\n \ \ \ \ - "localhost:\$IP\"' ./conformance-suite/docker-compose-dev.yml

- name: Get IS zip
run: |
INPUT_URL=${{github.event.inputs.download-url}}
INPUT_TAG=${{github.event.inputs.tag}}
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
if [[ -z "${INPUT_URL}" ]] && [[ -z "${INPUT_TAG}" ]]; then
echo "Either 'tag' or 'download-url' must be provided."
if [[ -z "${INPUT_TAG}" ]]; then
echo ">>> Building IS from source..."
mkdir cloned-product-is
cd cloned-product-is
git clone https://github.com/wso2/product-is
cd product-is
mvn clean install -Dmaven.test.skip=true | tee mvn-build.log
REPO_BUILD_STATUS=$(cat mvn-build.log | grep "\[INFO\] BUILD" | grep -oE '[^ ]+$')
echo "==========================================================="
echo "BUILD $REPO_BUILD_STATUS"
echo "=========================================================="
if [[ "${REPO_BUILD_STATUS}" != "SUCCESS" ]]; then
exit 1
fi
fi
if [[ -z "${INPUT_URL}" ]]; then
zip_file=$(find . -name 'wso2is-*.zip' -type f -not -name 'wso2is-*-src.zip' -print -quit)
if [[ -z "$zip_file" ]]; then
echo "Zip file not found"
exit 1
fi
echo ">>> Zip file found: $zip_file"
echo ">>> Copying zip file to the root directory ..."
cp "$zip_file" ./../../
cd ../..
ls
echo ">>> Remove cloned-product-is directory"
rm -rf cloned-product-is
ls
else
owner="wso2"
repo="product-is"
if [[ -z "${INPUT_TAG}" ]]; then
Expand All @@ -79,39 +124,17 @@ jobs:
list_asset_url="https://api.github.com/repos/${owner}/${repo}/releases/tags/${tag_trimmed}"
asset_url=$(curl "${list_asset_url}" | jq ".assets[] | select(.name==\"${artifact}\") | .url" | sed 's/\"//g')
curl -vLJO -H 'Accept: application/octet-stream' \
"${asset_url}"
else
curl -vLJO -H 'Accept: application/octet-stream' \
"${INPUT_URL}"
"${asset_url}"
fi
- name: Clone conformance suite
run: |
sudo snap install jq
LATEST_RELEASE_BRANCH=$(curl -s https://gitlab.com/api/v4/projects/4175605/releases/ | jq '.[]' | jq -r '.name' | head -1)
echo ">>> Conformance suite latest release branch: $LATEST_RELEASE_BRANCH"
PROVIDED_VERSION=${{github.event.inputs.conformance-suite-version}}
if [[ -z "${PROVIDED_VERSION}" ]]; then
CONFORMANCE_SUITE_BRANCH=$LATEST_RELEASE_BRANCH
echo ">>> Conformance suite latest release branch is taken: $CONFORMANCE_SUITE_BRANCH"
else
CONFORMANCE_SUITE_BRANCH=$PROVIDED_VERSION
echo ">>> Conformance suite provided branch is taken: $CONFORMANCE_SUITE_BRANCH"
fi
echo ">>> Selected conformance suite branch: $CONFORMANCE_SUITE_BRANCH"
git clone --depth 1 --branch ${CONFORMANCE_SUITE_BRANCH} https://gitlab.com/openid/conformance-suite.git
- name: Adding extra hosts to docker-compose-dev.yml
run: sed -i '/^ volumes.*/i \ \ \ \ extra_hosts:\n \ \ \ \ - "localhost:\$IP\"' ./conformance-suite/docker-compose-dev.yml

- name: Run IS
run: |
PRODUCT_IS_ZIP=$(find ./ -name wso2is* -type f -printf "%f\n")
cd ./product-is/oidc-conformance-tests
python3 ./configure_is.py ../../$PRODUCT_IS_ZIP
- name: Set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
Expand Down Expand Up @@ -157,14 +180,14 @@ jobs:
fi
- name: Archive test results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: ./*test_results.zip

- name: Archive test logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: test-logs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
"callbackURLs": [
"https://localhost.emobix.co.uk:8443/test/a/test/callback"
],
"allowedOrigins": []
"allowedOrigins": [],
"hybridFlow": {
"enable": true,
"responseType": "code id_token"
}
}
},
"authenticationSequence": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
"callbackURLs": [
"https://localhost.emobix.co.uk:8443/test/a/test/callback"
],
"allowedOrigins": []
"allowedOrigins": [],
"hybridFlow": {
"enable": true,
"responseType": "code id_token"
}
}
},
"authenticationSequence": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
"callbackURLs": [
"https://localhost.emobix.co.uk:8443/test/a/test/callback"
],
"allowedOrigins": []
"allowedOrigins": [],
"hybridFlow": {
"enable": true,
"responseType": "code id_token"
}
}
},
"authenticationSequence": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
"callbackURLs": [
"https://localhost.emobix.co.uk:8443/test/a/test/callback"
],
"allowedOrigins": []
"allowedOrigins": [],
"hybridFlow": {
"enable": true,
"responseType": "code id_token"
}
}
},
"authenticationSequence": {
Expand Down

0 comments on commit 6fddd28

Please sign in to comment.