Merge pull request #13365 from cli/wm-fix-skills-acceptance-tests
Fix skills acceptance tests
This commit is contained in:
commit
b77d79c4e1
2 changed files with 22 additions and 24 deletions
|
|
@ -1,20 +1,21 @@
|
|||
# Two namespaced skills with the same base name in the same repo should
|
||||
# Two namespaced skills with different base names in the same repo should
|
||||
# be independently installable using path-based disambiguation.
|
||||
# Skills are installed flat (by base name) so each must have a unique name.
|
||||
|
||||
# Use gh as a credential helper
|
||||
exec gh auth setup-git
|
||||
|
||||
# Create a repo with two namespaced skills that share the name "deploy"
|
||||
# Create a repo with two namespaced skills that have unique base names
|
||||
exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --public --add-readme
|
||||
defer gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING
|
||||
|
||||
exec gh repo clone $ORG/$SCRIPT_NAME-$RANDOM_STRING
|
||||
cd $SCRIPT_NAME-$RANDOM_STRING
|
||||
|
||||
mkdir -p skills/alice/deploy
|
||||
mkdir -p skills/bob/deploy
|
||||
cp $WORK/alice-skill.md skills/alice/deploy/SKILL.md
|
||||
cp $WORK/bob-skill.md skills/bob/deploy/SKILL.md
|
||||
mkdir -p skills/alice/alice-deploy
|
||||
mkdir -p skills/bob/bob-deploy
|
||||
cp $WORK/alice-skill.md skills/alice/alice-deploy/SKILL.md
|
||||
cp $WORK/bob-skill.md skills/bob/bob-deploy/SKILL.md
|
||||
|
||||
exec git add -A
|
||||
exec git commit -m 'Add namespaced skills'
|
||||
|
|
@ -23,25 +24,25 @@ exec git push origin main
|
|||
# Publish so the skills are discoverable
|
||||
exec gh skill publish --tag v1.0.0
|
||||
|
||||
# Install alice's deploy skill using the full path to disambiguate
|
||||
exec gh skill install $ORG/$SCRIPT_NAME-$RANDOM_STRING skills/alice/deploy --scope user --force
|
||||
stdout 'Installed alice/deploy'
|
||||
# Install alice's skill using the full path to disambiguate
|
||||
exec gh skill install $ORG/$SCRIPT_NAME-$RANDOM_STRING skills/alice/alice-deploy --scope user --force
|
||||
stdout 'Installed alice/alice-deploy'
|
||||
|
||||
# Install bob's deploy skill using the full path
|
||||
exec gh skill install $ORG/$SCRIPT_NAME-$RANDOM_STRING skills/bob/deploy --scope user --force
|
||||
stdout 'Installed bob/deploy'
|
||||
# Install bob's skill using the full path
|
||||
exec gh skill install $ORG/$SCRIPT_NAME-$RANDOM_STRING skills/bob/bob-deploy --scope user --force
|
||||
stdout 'Installed bob/bob-deploy'
|
||||
|
||||
# Verify both were installed to separate directories
|
||||
exists $HOME/.copilot/skills/alice/deploy/SKILL.md
|
||||
exists $HOME/.copilot/skills/bob/deploy/SKILL.md
|
||||
# Verify both were installed to flat directories (by base name)
|
||||
exists $HOME/.copilot/skills/alice-deploy/SKILL.md
|
||||
exists $HOME/.copilot/skills/bob-deploy/SKILL.md
|
||||
|
||||
# Verify each has the correct content
|
||||
grep 'Alice' $HOME/.copilot/skills/alice/deploy/SKILL.md
|
||||
grep 'Bob' $HOME/.copilot/skills/bob/deploy/SKILL.md
|
||||
grep 'Alice' $HOME/.copilot/skills/alice-deploy/SKILL.md
|
||||
grep 'Bob' $HOME/.copilot/skills/bob-deploy/SKILL.md
|
||||
|
||||
-- alice-skill.md --
|
||||
---
|
||||
name: deploy
|
||||
name: alice-deploy
|
||||
description: Alice's deployment skill
|
||||
---
|
||||
|
||||
|
|
@ -51,7 +52,7 @@ Deploys infrastructure using Alice's conventions.
|
|||
|
||||
-- bob-skill.md --
|
||||
---
|
||||
name: deploy
|
||||
name: bob-deploy
|
||||
description: Bob's deployment skill
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
# Publish dry-run from a directory with no skills/ should fail gracefully
|
||||
! exec gh skill publish --dry-run $WORK
|
||||
mkdir $WORK/empty-dir
|
||||
! exec gh skill publish --dry-run $WORK/empty-dir
|
||||
stderr 'no skills found in'
|
||||
|
||||
# Publish dry-run against a valid skill directory should succeed
|
||||
|
|
@ -10,10 +11,6 @@ stdout 'hello-world'
|
|||
exec gh skill publish --dry-run --tag v1.0.0 $WORK/test-repo
|
||||
stdout 'hello-world'
|
||||
|
||||
# Publish dry-run with --fix
|
||||
exec gh skill publish --dry-run --fix $WORK/test-repo
|
||||
stdout 'hello-world'
|
||||
|
||||
-- test-repo/skills/hello-world/SKILL.md --
|
||||
---
|
||||
name: hello-world
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue