forked from claude-did-this/claude-hub
fix(ci): resolve CI pipeline failures
- Fix jest command not found in coverage job by using npx jest - Fix lint command in CI/CD pipeline to use lint:check - Fix E2E test helper conditionalDescribe function to properly skip tests when Docker images are missing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -111,7 +111,7 @@ jobs:
|
||||
run: npm ci --prefer-offline --no-audit
|
||||
|
||||
- name: Generate test coverage
|
||||
run: jest --coverage --testPathPattern='test/(unit|integration).*\.test\.js$'
|
||||
run: npx jest --coverage --testPathPattern='test/(unit|integration).*\.test\.js$'
|
||||
env:
|
||||
NODE_ENV: test
|
||||
BOT_USERNAME: '@TestBot'
|
||||
|
||||
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
@@ -37,7 +37,7 @@ jobs:
|
||||
run: npm ci --prefer-offline --no-audit
|
||||
|
||||
- name: Run linter
|
||||
run: npm run lint
|
||||
run: npm run lint:check
|
||||
|
||||
- name: Run tests
|
||||
run: npm test
|
||||
|
||||
@@ -81,32 +81,28 @@ function conditionalDescribe(suiteName, suiteFunction, options = {}) {
|
||||
const { dockerImage, requiredEnvVars = [] } = options;
|
||||
|
||||
describe(suiteName, () => {
|
||||
let shouldSkip = false;
|
||||
|
||||
beforeAll(async () => {
|
||||
// Check Docker image
|
||||
if (dockerImage) {
|
||||
shouldSkip = await skipIfDockerImageMissing(dockerImage);
|
||||
const imageExists = await dockerImageExists(dockerImage);
|
||||
if (!imageExists) {
|
||||
console.warn(`⚠️ Skipping test suite '${suiteName}': Docker image '${dockerImage}' not found`);
|
||||
throw new Error(`Docker image '${dockerImage}' not found - skipping tests`);
|
||||
}
|
||||
}
|
||||
|
||||
// Check environment variables
|
||||
if (!shouldSkip && requiredEnvVars.length > 0) {
|
||||
shouldSkip = skipIfEnvVarsMissing(requiredEnvVars);
|
||||
}
|
||||
|
||||
if (shouldSkip) {
|
||||
console.log(`Skipping entire test suite: ${suiteName}`);
|
||||
if (requiredEnvVars.length > 0) {
|
||||
const { missing, hasAll } = checkRequiredEnvVars(requiredEnvVars);
|
||||
if (!hasAll) {
|
||||
console.warn(`⚠️ Skipping test suite '${suiteName}': Missing environment variables: ${missing.join(', ')}`);
|
||||
throw new Error(`Missing environment variables: ${missing.join(', ')} - skipping tests`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Run the actual tests if not skipping
|
||||
if (!shouldSkip) {
|
||||
suiteFunction();
|
||||
} else {
|
||||
test('Skipped due to missing requirements', () => {
|
||||
console.log('Test suite was skipped');
|
||||
});
|
||||
}
|
||||
// Run the actual test suite
|
||||
suiteFunction();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user