Skip to content

Commit

Permalink
SONARPHP-1523 Run ruling test in separate tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
GabinL21 committed Nov 6, 2024
1 parent a0f3beb commit ec6625e
Showing 1 changed file with 47 additions and 18 deletions.
65 changes: 47 additions & 18 deletions .cirrus/modules/qa.star
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ def on_failure():
}


#
# Windows
#

def qa_win_script():
return [
"git config --global core.autocrlf input",
Expand Down Expand Up @@ -56,7 +60,7 @@ def qa_os_win_task():
# Commons
#

def qa_task(env):
def qa_task(env, run_its_script):
return {
"only_if": is_branch_qa_eligible(),
"depends_on": "build",
Expand All @@ -67,29 +71,19 @@ def qa_task(env):
"set_orchestrator_home_script": set_orchestrator_home_script(),
"mkdir_orchestrator_home_script": mkdir_orchestrator_home_script(),
"orchestrator_cache": orchestrator_cache(),
"run_its_script": run_its_script(),
"run_its_script": run_its_script,
"on_failure": on_failure(),
"cleanup_gradle_script": cleanup_gradle_script(),
}


def run_its_script():
return [
"git submodule update --init --depth 1",
"source cirrus-env QA",
"source .cirrus/use-gradle-wrapper.sh",
"./gradlew \"${GRADLE_TASK}\" ${GRADLE_FLAGS} \"-Dsonar.runtimeVersion=${SQ_VERSION}\" --info --build-cache --console plain --no-daemon"
]


#
# Plugin
#

def qa_plugin_env():
return {
"GRADLE_TASK": QA_PLUGIN_GRADLE_TASK,
"GRADLE_FLAGS": "",
"KEEP_ORCHESTRATOR_RUNNING": "true",
"matrix": [
{"SQ_VERSION": QA_QUBE_LATEST_RELEASE},
Expand All @@ -99,9 +93,18 @@ def qa_plugin_env():
}


def qa_plugin_script():
return [
"git submodule update --init --depth 1",
"source cirrus-env QA",
"source .cirrus/use-gradle-wrapper.sh",
"./gradlew \"${GRADLE_TASK}\" \"-Dsonar.runtimeVersion=${SQ_VERSION}\" --info --build-cache --console plain --no-daemon"
]


def qa_plugin_task():
return {
"qa_plugin_task": qa_task(qa_plugin_env())
"qa_plugin_task": qa_task(qa_plugin_env(), qa_plugin_script())
}


Expand All @@ -112,16 +115,34 @@ def qa_plugin_task():
def qa_ruling_env():
return {
"GRADLE_TASK": QA_RULING_GRADLE_TASK,
"GRADLE_FLAGS": "",
"SQ_VERSION": QA_QUBE_LATEST_RELEASE,
"KEEP_ORCHESTRATOR_RUNNING": "true",
"GITHUB_TOKEN": "VAULT[development/github/token/licenses-ro token]",
"matrix": [
{"PHP_PROJECT": "Flysystem"},
{"PHP_PROJECT": "Monica"},
{"PHP_PROJECT": "PhpCodeSniffer"},
{"PHP_PROJECT": "PhpMailer"},
{"PHP_PROJECT": "Psysh"},
{"PHP_PROJECT": "PhpWord"},
{"PHP_PROJECT": "RubixML"},
{"PHP_PROJECT": "PhpSpreadsheet"},
],
"GITHUB_TOKEN": "VAULT[development/github/token/licenses-ro token]",
}


def qa_ruling_script():
return [
"git submodule update --init --depth 1",
"source cirrus-env QA",
"source .cirrus/use-gradle-wrapper.sh",
"./gradlew \"${GRADLE_TASK}\" \"--tests PhpGeneralRulingTest.test${PHP_PROJECT} -Dsonar.runtimeVersion=${SQ_VERSION}\" --info --build-cache --console plain --no-daemon"
]


def qa_ruling_task():
return {
"qa_ruling_task": qa_task(qa_ruling_env())
"qa_ruling_task": qa_task(qa_ruling_env(), qa_ruling_script())
}


Expand All @@ -132,14 +153,22 @@ def qa_ruling_task():
def qa_pr_analysis_env():
return {
"GRADLE_TASK": QA_RULING_GRADLE_TASK,
"GRADLE_FLAGS": "--tests PhpPrAnalysisTest",
"SQ_VERSION": QA_QUBE_LATEST_RELEASE,
"KEEP_ORCHESTRATOR_RUNNING": "true",
"GITHUB_TOKEN": "VAULT[development/github/token/licenses-ro token]",
}


def qa_pr_analysis_script():
return [
"git submodule update --init --depth 1",
"source cirrus-env QA",
"source .cirrus/use-gradle-wrapper.sh",
"./gradlew \"${GRADLE_TASK}\" \"--tests PhpPrAnalysisTest -Dsonar.runtimeVersion=${SQ_VERSION}\" --info --build-cache --console plain --no-daemon"
]


def qa_pr_analysis_task():
return {
"qa_pr_analysis_task": qa_task(qa_pr_analysis_env())
"qa_pr_analysis_task": qa_task(qa_pr_analysis_env(), qa_pr_analysis_script())
}

0 comments on commit ec6625e

Please sign in to comment.