Skip to content

Commit bd4d9ab

Browse files
committed
Optimize regex and fix CI issue related to special skill names
1 parent 12fa806 commit bd4d9ab

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

.github/workflows/test-all-integration.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,14 @@ jobs:
110110

111111
- name: Integration tests - azure-ai
112112
id: integration-tests-azure-ai
113-
if: contains(inputs.skills, 'azure-ai')
113+
# works around the problem that azure-ai is a prefix of azure-aigateway
114+
if: contains(format(',{0},', inputs.skills), ',azure-ai,')
114115
env:
115116
DEBUG: ${{ inputs.debug && '1' || '' }}
116117
TEST_RUN_ID: all-integration
117118
run: |
118-
npm run test:integration azure-ai
119+
# works around the problem that azure-ai is a prefix of azure-aigateway
120+
npm run test:integration azure-ai/
119121
continue-on-error: true
120122

121123
- name: Integration tests - azure-aigateway

tests/eslint-rules/integration-test-name.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
*/
99

1010
// Placeholder regex — update this to match your naming convention.
11-
// Current pattern:
12-
// - without suffix after skill name "<lowercase-kebab-case-skill-name>_ - Integration Tests"
13-
// - with suffix after skill name "<lowercase-kebab-case-skill-name>_<test-name-suffix> - Integration Tests"
14-
const DEFAULT_NAME_PATTERN = /^[a-z0-9]+(-[a-z0-9]+)_[a-z0-9-]* - Integration Tests$/;
11+
// The test name must begin with the exact skill name terminated by an underscore, followed by an optional suffix and then the fixed " - Integration Tests" label.
12+
// Current pattern:
13+
// - without the optional suffix after skill name "<lowercase-kebab-case-skill-name>_ - Integration Tests"
14+
// - with the optional suffix after skill name "<lowercase-kebab-case-skill-name>_<test-name-suffix> - Integration Tests"
15+
const DEFAULT_NAME_PATTERN = /^[a-z0-9-]+_[a-z0-9-]* - Integration Tests$/;
1516

1617
/** @type {import("eslint").Rule.RuleModule} */
1718
const rule = {

tests/eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export default tseslint.config(
121121
rules: {
122122
// Update the pattern option below to change the required format.
123123
"custom/integration-test-name": ["error", {
124-
pattern: "^[a-z0-9]+(-[a-z0-9]+)*_[a-z0-9-]* - Integration Tests$"
124+
pattern: "^[a-z0-9-]+_[a-z0-9-]* - Integration Tests$"
125125
}],
126126
},
127127
}

0 commit comments

Comments
 (0)