1
0
mirror of https://github.com/owncloud/ocis.git synced 2025-04-18 23:44:07 +03:00

Merge pull request #11204 from owncloud/test/enable-scenario-line-references

[tests-only][full-ci] Remove SEND_SCENARIO_LINE_REFERENCES env
This commit is contained in:
Pradip Subedi 2025-04-08 10:07:40 +05:45 committed by GitHub
commit 941f192f79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 26 deletions

View File

@ -1064,7 +1064,6 @@ def localApiTests(ctx, name, suites, storage = "ocis", extra_environment = {}, w
"TEST_SERVER_URL": OCIS_URL,
"TEST_SERVER_FED_URL": OCIS_FED_URL,
"OCIS_REVA_DATA_ROOT": "%s" % (dirs["ocisRevaDataRoot"] if storage == "owncloud" else ""),
"SEND_SCENARIO_LINE_REFERENCES": "true",
"STORAGE_DRIVER": storage,
"BEHAT_SUITES": ",".join(suites),
"BEHAT_FILTER_TAGS": "~@skip&&~@skipOnGraph&&~@skipOnOcis-%s-Storage" % ("OC" if storage == "owncloud" else "OCIS"),
@ -1262,7 +1261,6 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, with_remote_php = Fa
"environment": {
"TEST_SERVER_URL": OCIS_URL,
"OCIS_REVA_DATA_ROOT": "%s" % (dirs["ocisRevaDataRoot"] if storage == "owncloud" else ""),
"SEND_SCENARIO_LINE_REFERENCES": "true",
"STORAGE_DRIVER": storage,
"BEHAT_FILTER_TAGS": filterTags,
"DIVIDE_INTO_NUM_PARTS": number_of_parts,

View File

@ -688,21 +688,10 @@ class HttpRequestHelper {
return json_decode($response->getBody()->getContents(), null, 512, JSON_THROW_ON_ERROR);
}
/**
* @return bool
*/
public static function sendScenarioLineReferencesInXRequestId(): bool {
return (\getenv("SEND_SCENARIO_LINE_REFERENCES") === "true");
}
/**
* @return string
*/
public static function getXRequestIdRegex(): string {
if (self::sendScenarioLineReferencesInXRequestId()) {
return '/^[a-zA-Z]+\/[a-zA-Z]+\.feature:\d+(-\d+)?$/';
}
$host = gethostname();
return "/^$host\/.*$/";
return '/^[a-zA-Z]+\/[a-zA-Z]+\.feature:\d+(-\d+)?$/';
}
}

View File

@ -842,10 +842,6 @@ class FeatureContext extends BehatVariablesContext {
* @return string
*/
public function getStepLineRef(): string {
if (!HttpRequestHelper::sendScenarioLineReferencesInXRequestId()) {
return '';
}
// If we are in BeforeScenario and possibly before any particular step
// is being executed, then stepLineRef might be empty. In that case
// return just the string for the scenario.
@ -2679,9 +2675,7 @@ class FeatureContext extends BehatVariablesContext {
$featureFile = $scope->getFeature()->getFile();
$suiteName = $scope->getSuite()->getName();
$featureFileName = \basename($featureFile);
if (HttpRequestHelper::sendScenarioLineReferencesInXRequestId()) {
$this->scenarioString = $suiteName . '/' . $featureFileName . ':' . $scenarioLine;
}
$this->scenarioString = $suiteName . '/' . $featureFileName . ':' . $scenarioLine;
// Initialize SetupHelper
SetupHelper::init(
@ -2706,11 +2700,7 @@ class FeatureContext extends BehatVariablesContext {
* @return void
*/
public function beforeEachStep(BeforeStepScope $scope): void {
if (HttpRequestHelper::sendScenarioLineReferencesInXRequestId()) {
$this->stepLineRef = $this->scenarioString . '-' . $scope->getStep()->getLine();
} else {
$this->stepLineRef = '';
}
$this->stepLineRef = $this->scenarioString . '-' . $scope->getStep()->getLine();
}
/**