test: skip marketplace contract tests when local repos are absent

This commit is contained in:
Jamie McGregor Nelson 2026-03-15 09:13:51 -04:00
parent 2e3fa903b1
commit 60413c4ea9
2 changed files with 23 additions and 8 deletions

View file

@ -17,13 +17,20 @@ import {
resolvePluginRoot
} from '../marketplace-discovery';
// Use absolute paths to the external marketplace repos
// These repos are located at /home/ubuntulinuxqa2/repos/
const REPOS_BASE = '/home/ubuntulinuxqa2/repos';
const CLAUDE_SKILLS_PATH = path.join(REPOS_BASE, 'claude_skills');
const CLAUDE_PLUGINS_OFFICIAL_PATH = path.join(REPOS_BASE, 'claude-plugins-official');
// Resolve paths relative to the gsd-2 project root so CI can skip cleanly when repos are absent
const GSD2_ROOT = path.resolve(import.meta.dirname, '../../../../..');
const CLAUDE_SKILLS_PATH = path.resolve(GSD2_ROOT, '../claude_skills');
const CLAUDE_PLUGINS_OFFICIAL_PATH = path.resolve(GSD2_ROOT, '../claude-plugins-official');
describe('parseMarketplaceJson', () => {
function marketplacesAvailable(): boolean {
return fs.existsSync(CLAUDE_SKILLS_PATH) && fs.existsSync(CLAUDE_PLUGINS_OFFICIAL_PATH);
}
const skipReason = !marketplacesAvailable()
? `Marketplace repos not found: ${CLAUDE_SKILLS_PATH}, ${CLAUDE_PLUGINS_OFFICIAL_PATH}`
: undefined;
describe('parseMarketplaceJson', { skip: skipReason }, () => {
it('should parse jamie-style marketplace.json', () => {
const result = parseMarketplaceJson(CLAUDE_SKILLS_PATH);
assert.strictEqual(result.success, true);

View file

@ -10,7 +10,7 @@
* Tests run against real data, not synthetic fixtures.
*/
import { describe, it, before } from 'node:test';
import { describe, it } from 'node:test';
import assert from 'node:assert';
import * as path from 'node:path';
import * as fs from 'node:fs';
@ -27,7 +27,15 @@ const REPOS_BASE = path.resolve(import.meta.dirname, '../../..');
const CLAUDE_SKILLS_PATH = path.join(REPOS_BASE, 'claude_skills');
const CLAUDE_PLUGINS_OFFICIAL_PATH = path.join(REPOS_BASE, 'claude-plugins-official');
describe('Marketplace Discovery Contract Tests', () => {
function marketplacesAvailable(): boolean {
return fs.existsSync(CLAUDE_SKILLS_PATH) && fs.existsSync(CLAUDE_PLUGINS_OFFICIAL_PATH);
}
const skipReason = !marketplacesAvailable()
? `Marketplace repos not found: ${CLAUDE_SKILLS_PATH}, ${CLAUDE_PLUGINS_OFFICIAL_PATH}`
: undefined;
describe('Marketplace Discovery Contract Tests', { skip: skipReason }, () => {
describe('claude_skills marketplace (jamie-style)', () => {
it('should discover at least 15 plugins', () => {
const result = discoverMarketplace(CLAUDE_SKILLS_PATH);