Skip to content

GL-2039: Added prompt for nodejs and php project selection. #2117

GL-2039: Added prompt for nodejs and php project selection.

GL-2039: Added prompt for nodejs and php project selection. #2117

Triggered via pull request February 28, 2024 15:30
Status Success
Total duration 7m 36s
Artifacts

mutation.yml

on: pull_request
Mutation Testing
7m 28s
Mutation Testing
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
Mutation Testing: src/Command/CodeStudio/CodeStudioCiCdVariables.php#L45
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ */ public static function getDefaultsForNode(?string $cloudApplicationUuid = NULL, ?string $cloudKey = NULL, ?string $cloudSecret = NULL, ?string $projectAccessTokenName = NULL, ?string $projectAccessToken = NULL, ?string $nodeVersion = NULL) : array { - return [['key' => 'ACQUIA_APPLICATION_UUID', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudApplicationUuid, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_KEY', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudKey, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudSecret, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_NAME', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessTokenName, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessToken, 'variable_type' => 'env_var'], ['key' => 'NODE_VERSION', 'masked' => FALSE, 'protected' => FALSE, 'value' => $nodeVersion, 'variable_type' => 'env_var']]; + return [['key' => 'ACQUIA_APPLICATION_UUID', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudApplicationUuid, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_KEY', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudKey, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudSecret, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_NAME', 'masked' => false, 'protected' => FALSE, 'value' => $projectAccessTokenName, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessToken, 'variable_type' => 'env_var'], ['key' => 'NODE_VERSION', 'masked' => FALSE, 'protected' => FALSE, 'value' => $nodeVersion, 'variable_type' => 'env_var']]; } /** * @return array<mixed>
Mutation Testing: src/Command/CodeStudio/CodeStudioCiCdVariables.php#L46
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ */ public static function getDefaultsForNode(?string $cloudApplicationUuid = NULL, ?string $cloudKey = NULL, ?string $cloudSecret = NULL, ?string $projectAccessTokenName = NULL, ?string $projectAccessToken = NULL, ?string $nodeVersion = NULL) : array { - return [['key' => 'ACQUIA_APPLICATION_UUID', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudApplicationUuid, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_KEY', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudKey, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudSecret, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_NAME', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessTokenName, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessToken, 'variable_type' => 'env_var'], ['key' => 'NODE_VERSION', 'masked' => FALSE, 'protected' => FALSE, 'value' => $nodeVersion, 'variable_type' => 'env_var']]; + return [['key' => 'ACQUIA_APPLICATION_UUID', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudApplicationUuid, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_KEY', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudKey, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudSecret, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_NAME', 'masked' => TRUE, 'protected' => true, 'value' => $projectAccessTokenName, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessToken, 'variable_type' => 'env_var'], ['key' => 'NODE_VERSION', 'masked' => FALSE, 'protected' => FALSE, 'value' => $nodeVersion, 'variable_type' => 'env_var']]; } /** * @return array<mixed>
Mutation Testing: src/Command/CodeStudio/CodeStudioCiCdVariables.php#L52
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ */ public static function getDefaultsForNode(?string $cloudApplicationUuid = NULL, ?string $cloudKey = NULL, ?string $cloudSecret = NULL, ?string $projectAccessTokenName = NULL, ?string $projectAccessToken = NULL, ?string $nodeVersion = NULL) : array { - return [['key' => 'ACQUIA_APPLICATION_UUID', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudApplicationUuid, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_KEY', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudKey, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudSecret, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_NAME', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessTokenName, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessToken, 'variable_type' => 'env_var'], ['key' => 'NODE_VERSION', 'masked' => FALSE, 'protected' => FALSE, 'value' => $nodeVersion, 'variable_type' => 'env_var']]; + return [['key' => 'ACQUIA_APPLICATION_UUID', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudApplicationUuid, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_KEY', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudKey, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudSecret, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_NAME', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessTokenName, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_SECRET', 'masked' => false, 'protected' => FALSE, 'value' => $projectAccessToken, 'variable_type' => 'env_var'], ['key' => 'NODE_VERSION', 'masked' => FALSE, 'protected' => FALSE, 'value' => $nodeVersion, 'variable_type' => 'env_var']]; } /** * @return array<mixed>
Mutation Testing: src/Command/CodeStudio/CodeStudioCiCdVariables.php#L53
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ */ public static function getDefaultsForNode(?string $cloudApplicationUuid = NULL, ?string $cloudKey = NULL, ?string $cloudSecret = NULL, ?string $projectAccessTokenName = NULL, ?string $projectAccessToken = NULL, ?string $nodeVersion = NULL) : array { - return [['key' => 'ACQUIA_APPLICATION_UUID', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudApplicationUuid, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_KEY', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudKey, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudSecret, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_NAME', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessTokenName, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessToken, 'variable_type' => 'env_var'], ['key' => 'NODE_VERSION', 'masked' => FALSE, 'protected' => FALSE, 'value' => $nodeVersion, 'variable_type' => 'env_var']]; + return [['key' => 'ACQUIA_APPLICATION_UUID', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudApplicationUuid, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_KEY', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudKey, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudSecret, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_NAME', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessTokenName, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_SECRET', 'masked' => TRUE, 'protected' => true, 'value' => $projectAccessToken, 'variable_type' => 'env_var'], ['key' => 'NODE_VERSION', 'masked' => FALSE, 'protected' => FALSE, 'value' => $nodeVersion, 'variable_type' => 'env_var']]; } /** * @return array<mixed>
Mutation Testing: src/Command/CodeStudio/CodeStudioCiCdVariables.php#L59
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ */ public static function getDefaultsForNode(?string $cloudApplicationUuid = NULL, ?string $cloudKey = NULL, ?string $cloudSecret = NULL, ?string $projectAccessTokenName = NULL, ?string $projectAccessToken = NULL, ?string $nodeVersion = NULL) : array { - return [['key' => 'ACQUIA_APPLICATION_UUID', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudApplicationUuid, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_KEY', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudKey, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudSecret, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_NAME', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessTokenName, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessToken, 'variable_type' => 'env_var'], ['key' => 'NODE_VERSION', 'masked' => FALSE, 'protected' => FALSE, 'value' => $nodeVersion, 'variable_type' => 'env_var']]; + return [['key' => 'ACQUIA_APPLICATION_UUID', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudApplicationUuid, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_KEY', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudKey, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudSecret, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_NAME', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessTokenName, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessToken, 'variable_type' => 'env_var'], ['key' => 'NODE_VERSION', 'masked' => true, 'protected' => FALSE, 'value' => $nodeVersion, 'variable_type' => 'env_var']]; } /** * @return array<mixed>
Mutation Testing: src/Command/CodeStudio/CodeStudioCiCdVariables.php#L60
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ */ public static function getDefaultsForNode(?string $cloudApplicationUuid = NULL, ?string $cloudKey = NULL, ?string $cloudSecret = NULL, ?string $projectAccessTokenName = NULL, ?string $projectAccessToken = NULL, ?string $nodeVersion = NULL) : array { - return [['key' => 'ACQUIA_APPLICATION_UUID', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudApplicationUuid, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_KEY', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudKey, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudSecret, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_NAME', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessTokenName, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessToken, 'variable_type' => 'env_var'], ['key' => 'NODE_VERSION', 'masked' => FALSE, 'protected' => FALSE, 'value' => $nodeVersion, 'variable_type' => 'env_var']]; + return [['key' => 'ACQUIA_APPLICATION_UUID', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudApplicationUuid, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_KEY', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudKey, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_CLOUD_API_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $cloudSecret, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_NAME', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessTokenName, 'variable_type' => 'env_var'], ['key' => 'ACQUIA_GLAB_TOKEN_SECRET', 'masked' => TRUE, 'protected' => FALSE, 'value' => $projectAccessToken, 'variable_type' => 'env_var'], ['key' => 'NODE_VERSION', 'masked' => FALSE, 'protected' => true, 'value' => $nodeVersion, 'variable_type' => 'env_var']]; } /** * @return array<mixed>
Mutation Testing: src/Command/CodeStudio/CodeStudioWizardCommand.php#L48
Escaped Mutant for Mutator "IncrementInteger": --- Original +++ New @@ @@ $phpVersion = NULL; $nodeVersion = NULL; $projectType = $this->getListOfProjectType(); - $projectSelected = $this->io->choice('Select a project type', $projectType, $projectType[0]); + $projectSelected = $this->io->choice('Select a project type', $projectType, $projectType[1]); switch ($projectSelected) { case "Drupal_project": $phpVersions = ['PHP_version_8.1' => "8.1", 'PHP_version_8.2' => "8.2"];
Mutation Testing: src/Command/CodeStudio/CodeStudioWizardCommand.php#L61
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ $phpVersion = $phpVersions[$project]; break; case "Node_project": - $nodeVersions = ['NODE_version_18.17.1' => "18.17.1", 'NODE_version_20.5.1' => "20.5.1"]; + $nodeVersions = ['NODE_version_20.5.1' => "20.5.1"]; $project = $this->io->choice('Select a NODE version', array_values($nodeVersions), $nodeVersions['NODE_version_20.5.1']); $project = array_search($project, $nodeVersions, TRUE); $nodeVersion = $nodeVersions[$project];
Mutation Testing: src/Command/CodeStudio/CodeStudioWizardCommand.php#L174
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ */ private function getListOfProjectType() : ?array { - $array = ['Drupal_project', 'Node_project']; + $array = ['Node_project']; return $array; } private function createProjectAccessToken(array $project, string $projectAccessTokenName) : string
Mutation Testing: src/Command/CodeStudio/CodeStudioWizardCommand.php#L202
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ } private function setGitLabCiCdVariablesForPhpProject(array $project, string $cloudApplicationUuid, string $cloudKey, string $cloudSecret, string $projectAccessTokenName, string $projectAccessToken, string $phpVersion) : void { - $this->io->writeln("Setting GitLab CI/CD variables for {$project['path_with_namespace']}.."); + $gitlabCicdVariables = CodeStudioCiCdVariables::getDefaultsForPhp($cloudApplicationUuid, $cloudKey, $cloudSecret, $projectAccessTokenName, $projectAccessToken, $phpVersion); $gitlabCicdExistingVariables = $this->gitLabClient->projects()->variables($project['id']); $gitlabCicdExistingVariablesKeyed = [];