Skip to content

Commit b77d79c

Browse files
authored
Merge pull request cli#13365 from cli/wm-fix-skills-acceptance-tests
Fix skills acceptance tests
2 parents 2297f1f + f47e459 commit b77d79c

2 files changed

Lines changed: 22 additions & 24 deletions

File tree

acceptance/testdata/skills/skills-install-namespaced.txtar

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
# Two namespaced skills with the same base name in the same repo should
1+
# Two namespaced skills with different base names in the same repo should
22
# be independently installable using path-based disambiguation.
3+
# Skills are installed flat (by base name) so each must have a unique name.
34

45
# Use gh as a credential helper
56
exec gh auth setup-git
67

7-
# Create a repo with two namespaced skills that share the name "deploy"
8+
# Create a repo with two namespaced skills that have unique base names
89
exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --public --add-readme
910
defer gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING
1011

1112
exec gh repo clone $ORG/$SCRIPT_NAME-$RANDOM_STRING
1213
cd $SCRIPT_NAME-$RANDOM_STRING
1314

14-
mkdir -p skills/alice/deploy
15-
mkdir -p skills/bob/deploy
16-
cp $WORK/alice-skill.md skills/alice/deploy/SKILL.md
17-
cp $WORK/bob-skill.md skills/bob/deploy/SKILL.md
15+
mkdir -p skills/alice/alice-deploy
16+
mkdir -p skills/bob/bob-deploy
17+
cp $WORK/alice-skill.md skills/alice/alice-deploy/SKILL.md
18+
cp $WORK/bob-skill.md skills/bob/bob-deploy/SKILL.md
1819

1920
exec git add -A
2021
exec git commit -m 'Add namespaced skills'
@@ -23,25 +24,25 @@ exec git push origin main
2324
# Publish so the skills are discoverable
2425
exec gh skill publish --tag v1.0.0
2526

26-
# Install alice's deploy skill using the full path to disambiguate
27-
exec gh skill install $ORG/$SCRIPT_NAME-$RANDOM_STRING skills/alice/deploy --scope user --force
28-
stdout 'Installed alice/deploy'
27+
# Install alice's skill using the full path to disambiguate
28+
exec gh skill install $ORG/$SCRIPT_NAME-$RANDOM_STRING skills/alice/alice-deploy --scope user --force
29+
stdout 'Installed alice/alice-deploy'
2930

30-
# Install bob's deploy skill using the full path
31-
exec gh skill install $ORG/$SCRIPT_NAME-$RANDOM_STRING skills/bob/deploy --scope user --force
32-
stdout 'Installed bob/deploy'
31+
# Install bob's skill using the full path
32+
exec gh skill install $ORG/$SCRIPT_NAME-$RANDOM_STRING skills/bob/bob-deploy --scope user --force
33+
stdout 'Installed bob/bob-deploy'
3334

34-
# Verify both were installed to separate directories
35-
exists $HOME/.copilot/skills/alice/deploy/SKILL.md
36-
exists $HOME/.copilot/skills/bob/deploy/SKILL.md
35+
# Verify both were installed to flat directories (by base name)
36+
exists $HOME/.copilot/skills/alice-deploy/SKILL.md
37+
exists $HOME/.copilot/skills/bob-deploy/SKILL.md
3738

3839
# Verify each has the correct content
39-
grep 'Alice' $HOME/.copilot/skills/alice/deploy/SKILL.md
40-
grep 'Bob' $HOME/.copilot/skills/bob/deploy/SKILL.md
40+
grep 'Alice' $HOME/.copilot/skills/alice-deploy/SKILL.md
41+
grep 'Bob' $HOME/.copilot/skills/bob-deploy/SKILL.md
4142

4243
-- alice-skill.md --
4344
---
44-
name: deploy
45+
name: alice-deploy
4546
description: Alice's deployment skill
4647
---
4748

@@ -51,7 +52,7 @@ Deploys infrastructure using Alice's conventions.
5152

5253
-- bob-skill.md --
5354
---
54-
name: deploy
55+
name: bob-deploy
5556
description: Bob's deployment skill
5657
---
5758

acceptance/testdata/skills/skills-publish-dry-run.txtar

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Publish dry-run from a directory with no skills/ should fail gracefully
2-
! exec gh skill publish --dry-run $WORK
2+
mkdir $WORK/empty-dir
3+
! exec gh skill publish --dry-run $WORK/empty-dir
34
stderr 'no skills found in'
45

56
# Publish dry-run against a valid skill directory should succeed
@@ -10,10 +11,6 @@ stdout 'hello-world'
1011
exec gh skill publish --dry-run --tag v1.0.0 $WORK/test-repo
1112
stdout 'hello-world'
1213

13-
# Publish dry-run with --fix
14-
exec gh skill publish --dry-run --fix $WORK/test-repo
15-
stdout 'hello-world'
16-
1714
-- test-repo/skills/hello-world/SKILL.md --
1815
---
1916
name: hello-world

0 commit comments

Comments
 (0)