mirror of
https://github.com/keycloak/keycloak.git
synced 2026-05-26 13:50:48 +00:00
GH actions for ci.yaml workflow - testsuite deprecation check. (#46351)
Signed-off-by: Lukas Hanusovsky <lhanusov@redhat.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
name: Testsuite deprecation check
|
||||
description: Check PR if there are changes in the old deprecated testsuite
|
||||
|
||||
inputs:
|
||||
token:
|
||||
description: GitHub Token
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- id: check-testsuite-changes
|
||||
name: Check Old Testsuite changes in PR
|
||||
shell: bash
|
||||
run: .github/actions/testsuite-deprecation-check/deprecation-check.sh ${{ github.repository }} ${{ github.ref }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ inputs.token }}
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
REPOSITORY="$1"
|
||||
REF="$2"
|
||||
|
||||
CHANGE_ID=$(echo $REF | cut -f 3 -d '/')
|
||||
|
||||
echo "========================================================================================"
|
||||
echo "Checking testsuite module additions/changes."
|
||||
echo "----------------------------------------------------------------------------------------"
|
||||
|
||||
ADDED_FILES=$(gh api -X GET --paginate repos/$REPOSITORY/pulls/$CHANGE_ID/files --jq 'map(select(.filename | contains("testsuite/")) | select (.status | contains("added")) | {filename}) | length')
|
||||
CHANGED_FILES=$(gh api -X GET --paginate repos/$REPOSITORY/pulls/$CHANGE_ID/files --jq 'map(select(.filename | contains("testsuite/")) | select (.additions >= 50) | {filename}) | length')
|
||||
|
||||
# Check if changed files matches regex
|
||||
if [[ $ADDED_FILES > 0 || $CHANGED_FILES > 0 ]] ; then
|
||||
echo "========================================================================================"
|
||||
echo "Deprecated testsuite module: "
|
||||
echo " * Adding new file(s) is forbidden."
|
||||
echo " * Maximum 50 lines can be added to a single file."
|
||||
echo ""
|
||||
echo "Please, migrate the added/changed file(s) and use the new test framework instead."
|
||||
echo "See: https://github.com/keycloak/keycloak/tree/main/testsuite/DEPRECATED.md for more details."
|
||||
echo "----------------------------------------------------------------------------------------"
|
||||
exit 1
|
||||
fi
|
||||
@@ -87,6 +87,18 @@ jobs:
|
||||
fi
|
||||
echo "run-additional-dbs-tests=$RUN_ADDITIONAL_DBS_TESTS" >> $GITHUB_OUTPUT
|
||||
|
||||
testsuite-deprecation-check:
|
||||
name: Testsuite Deprecation Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
|
||||
- id: conditional
|
||||
uses: ./.github/actions/testsuite-deprecation-check
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
build:
|
||||
name: Build
|
||||
if: needs.conditional.outputs.ci == 'true'
|
||||
@@ -1252,6 +1264,7 @@ jobs:
|
||||
- base-new-integration-tests
|
||||
- mixed-cluster-compatibility-tests
|
||||
- admin-v2-tests
|
||||
- testsuite-deprecation-check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# Deprecating the Old Testsuite Module
|
||||
If you find yourself reading this document, you are probably asked to migrate a test from your PR to use the new Test Framework.
|
||||
|
||||
---
|
||||
With the release of the new Test Framework, this testsuite module, with all related dependents, is officially deprecated.
|
||||
|
||||
Specifically speaking:
|
||||
* **Arquillian** testsuite
|
||||
* **Model** testsuite
|
||||
* All related **utility** modules
|
||||
|
||||
A limited amount of changes to existing tests are permitted, and should primarily be used to add test-cases when resolving bugs. Adding new files is not allowed.
|
||||
|
||||
## Why Deprecated?
|
||||
* The Arquillian framework is not a community maintained project anymore.
|
||||
* It's using JUnit 4
|
||||
* The test configuration got messy over the years.
|
||||
* Onboarding process has a steep learning curve.
|
||||
* Adding new features is complex and non-trivial task.
|
||||
|
||||
## How to Migrate Your Test?
|
||||
The new Test Framework brings completely new test configuration and server lifecycle management.
|
||||
It is tailored to quickly onboard and speed-up the feature development, or contributing a simple bug fix.
|
||||
|
||||
Please, follow the new guidelines:
|
||||
* [Test Framework](../test-framework/docs/README.md)
|
||||
* [Migrating Tests](../tests/MANUAL_MIGRATION.md)
|
||||
+1
@@ -114,6 +114,7 @@ import static org.junit.Assert.assertEquals;
|
||||
*
|
||||
* @author tkyjovsk
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
@RunWith(KcArquillian.class)
|
||||
@RunAsClient
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
|
||||
@@ -127,6 +127,7 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||
* If no parameters are set via this property, the tests derived from this class are skipped.
|
||||
* @author hmlnarik
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public abstract class KeycloakModelTest {
|
||||
private static final Logger LOG = Logger.getLogger(KeycloakModelParameters.class);
|
||||
private static final AtomicInteger FACTORY_COUNT = new AtomicInteger();
|
||||
|
||||
Reference in New Issue
Block a user