Merge pull request #90 from intelligence-assist/fix/ci-pipeline-failures

fix(ci): resolve CI pipeline failures
This commit is contained in:
Cheffromspace
2025-05-27 13:30:03 -05:00
committed by GitHub
3 changed files with 15 additions and 19 deletions

View File

@@ -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'

View File

@@ -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

View File

@@ -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();
});
}