From f47e459cf556aa492172491fbfb105af0b18e1b3 Mon Sep 17 00:00:00 2001 From: William Martin Date: Thu, 7 May 2026 20:33:42 +0200 Subject: [PATCH] Fix skills acceptance tests --- .../skills/skills-install-namespaced.txtar | 39 ++++++++++--------- .../skills/skills-publish-dry-run.txtar | 7 +--- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/acceptance/testdata/skills/skills-install-namespaced.txtar b/acceptance/testdata/skills/skills-install-namespaced.txtar index db39bead0..9aa83ef56 100644 --- a/acceptance/testdata/skills/skills-install-namespaced.txtar +++ b/acceptance/testdata/skills/skills-install-namespaced.txtar @@ -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 --- diff --git a/acceptance/testdata/skills/skills-publish-dry-run.txtar b/acceptance/testdata/skills/skills-publish-dry-run.txtar index 786204951..fe4d160c3 100644 --- a/acceptance/testdata/skills/skills-publish-dry-run.txtar +++ b/acceptance/testdata/skills/skills-publish-dry-run.txtar @@ -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