Skip to content

Commit

Permalink
Run behave files in a loop
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdenise committed May 27, 2024
1 parent 43758d7 commit 296dbd8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/test-wildfly-cloud-fp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: jitterbit/get-changed-files@v1
- run: |
for changed_file in ${{ steps.files.outputs.all }}; do
if [[ ! "${changed_file}" =~ ^jboss/container/wildfly/s2i/2.0/.* ]] && [[ ! "${changed_file}" =~ ^jboss/container/wildfly/run/.* ]] && [[ "${changed_file}" =~ ^jboss/container/wildfly/.* ]]; then
if [[ "${changed_file}" =~ ^\.github/workflows/test-wildfly-cloud-fp.yml ]] || ( [[ ! "${changed_file}" =~ ^jboss/container/wildfly/s2i/2.0/.* ]] && [[ ! "${changed_file}" =~ ^jboss/container/wildfly/run/.* ]] && [[ "${changed_file}" =~ ^jboss/container/wildfly/.* ]] ); then
echo "Change detected in ${changed_file}, will build cloud feature-pack and test images."
echo "IMPACT_CLOUD_FP=true" >> "$GITHUB_ENV"
exit 0
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
cekit build --overrides=jdk11-overrides.yaml docker
cekit build --overrides=jdk21-overrides.yaml docker
popd
docker image ls
working-directory: wildfly-s2i
Expand All @@ -129,8 +129,18 @@ jobs:
sed -i "s|$legacyPlaceHolder|$legacyReplacement|" "$feature"
done
. ~/cekit/bin/activate
pushd custom-cloud-image/wildfly-builder-image
cekit test --image=wildfly/wildfly-s2i:dev-${{ env.CLOUD_FP_VERSION }} behave
pushd custom-cloud-image/
mkdir -p all-tests
mv wildfly-builder-image/tests/features/*.feature all-tests
for feature in all-tests/*.feature; do
cp $feature wildfly-builder-image/tests/features/
pushd wildfly-builder-image
echo "Testing feature file $(basename ${feature})"
cekit test --image=wildfly/wildfly-s2i:dev-${{ env.CLOUD_FP_VERSION }} behave
docker system prune -f
popd
rm wildfly-builder-image/tests/features/*.feature
done
popd
working-directory: wildfly-cloud-galleon-pack
- name: List containers
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/test-wildfly-s2i.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: jitterbit/get-changed-files@v1
- run: |
for changed_file in ${{ steps.files.outputs.all }}; do
if [[ "${changed_file}" =~ ^jboss/container/wildfly/s2i/2.0/.* ]] || [[ "${changed_file}" =~ ^jboss/container/wildfly/run/.* ]]; then
if [[ "${changed_file}" =~ ^\.github/workflows/test-wildfly-s2i.yml ]] || [[ "${changed_file}" =~ ^jboss/container/wildfly/s2i/2.0/.* ]] || [[ "${changed_file}" =~ ^jboss/container/wildfly/run/.* ]]; then
echo "Change detected in ${changed_file}, will test image."
echo "IMPACT_IMAGE=true" >> "$GITHUB_ENV"
exit 0
Expand Down Expand Up @@ -85,25 +85,33 @@ jobs:
. ~/cekit/bin/activate
overrides="{\"modules\": {\"repositories\": [{\"name\":\"wildfly-cekit-modules\",\"path\":\"../../wildfly-cekit-modules\"}]}}"
pushd wildfly-builder-image
cekit build --overrides=jdk11-overrides.yaml --overrides "$overrides" docker
cekit build --overrides=jdk21-overrides.yaml --overrides "$overrides" docker
popd
pushd wildfly-runtime-image
cekit build --overrides=jdk11-overrides.yaml --overrides "$overrides" docker
cekit build --overrides=jdk21-overrides.yaml --overrides "$overrides" docker
popd
docker image ls
working-directory: wildfly-s2i
- name: Behave Tests
if: env.IMPACT_IMAGE == 'true'
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
cekit -v test --overrides=jdk11-overrides.yaml behave
popd
mkdir -p all-tests
mv wildfly-builder-image/tests/features/*.feature all-tests
for feature in all-tests/*.feature; do
cp $feature wildfly-builder-image/tests/features/
pushd wildfly-builder-image
echo "Testing feature file $(basename ${feature})"
cekit test --overrides=jdk21-overrides.yaml behave
docker system prune -f
popd
rm wildfly-builder-image/tests/features/*.feature
done
working-directory: wildfly-s2i
- name: Additional Tests
if: env.IMPACT_IMAGE == 'true'
run: |
export IMAGE_VERSION=$(yq e ".version" wildfly-runtime-image/jdk11-overrides.yaml)
export IMAGE_VERSION=$(yq e ".version" wildfly-runtime-image/jdk21-overrides.yaml)
export NAMESPACE=wildfly
export IMAGE_NAME=${NAMESPACE}/wildfly-s2i
export RUNTIME_IMAGE_NAME=${NAMESPACE}/wildfly-runtime
Expand Down

0 comments on commit 296dbd8

Please sign in to comment.