* Returns the test environments as specified in the YAML file.
()
| 96 | * Returns the test environments as specified in the YAML file. |
| 97 | */ |
| 98 | async getTests() { |
| 99 | try { |
| 100 | // Get CI workflow |
| 101 | const ciYaml = await fs.readFile(this.yamlFilePath, 'utf-8'); |
| 102 | const ci = yaml.parse(ciYaml); |
| 103 | |
| 104 | // Extract package versions |
| 105 | let versions = this.ciEnvironmentsKeyPath.split('.').reduce((o,k) => o !== undefined ? o[k] : undefined, ci); |
| 106 | versions = Object.entries(versions) |
| 107 | .map(entry => entry[1]) |
| 108 | .filter(entry => entry[this.ciVersionKey]); |
| 109 | |
| 110 | return versions; |
| 111 | } catch (e) { |
| 112 | throw `Failed to determine ${this.packageName} versions from CI YAML file with error: ${e}`; |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * Returns the package versions which are missing in the CI environment. |