* Run all tests
()
| 517 | * Run all tests |
| 518 | */ |
| 519 | async runAllTests() { |
| 520 | header('Release Automation Test Suite'); |
| 521 | |
| 522 | info('Testing release automation components...'); |
| 523 | |
| 524 | this.testFileExistence(); |
| 525 | this.testVersionDetection(); |
| 526 | this.testChangelogParsing(); |
| 527 | this.testBuildProcess(); |
| 528 | this.testNpmPublishPrep(); |
| 529 | this.testDockerConfig(); |
| 530 | this.testWorkflowSyntax(); |
| 531 | this.testEnvironment(); |
| 532 | |
| 533 | // Summary |
| 534 | header('Test Summary'); |
| 535 | |
| 536 | if (this.errors.length === 0 && this.warnings.length === 0) { |
| 537 | log('🎉 All tests passed! Release automation is ready.', 'green'); |
| 538 | } else { |
| 539 | if (this.errors.length > 0) { |
| 540 | log(`\n❌ ${this.errors.length} Error(s):`, 'red'); |
| 541 | this.errors.forEach(err => log(` • ${err}`, 'red')); |
| 542 | } |
| 543 | |
| 544 | if (this.warnings.length > 0) { |
| 545 | log(`\n⚠️ ${this.warnings.length} Warning(s):`, 'yellow'); |
| 546 | this.warnings.forEach(warn => log(` • ${warn}`, 'yellow')); |
| 547 | } |
| 548 | |
| 549 | if (this.errors.length > 0) { |
| 550 | log('\n🔧 Please fix the errors before running the release workflow.', 'red'); |
| 551 | process.exit(1); |
| 552 | } else { |
| 553 | log('\n✅ No critical errors found. Warnings should be reviewed but won\'t prevent releases.', 'yellow'); |
| 554 | } |
| 555 | } |
| 556 | |
| 557 | // Next steps |
| 558 | log('\n📋 Next Steps:', 'cyan'); |
| 559 | log('1. Ensure GitHub repository settings are configured:', 'cyan'); |
| 560 | log(' • Secrets: DOCKERHUB_USERNAME, DOCKERHUB_TOKEN', 'cyan'); |
| 561 | log(' • Environment "npm-publish" exists (Settings → Environments)', 'cyan'); |
| 562 | log(' • npm Trusted Publisher configured on npmjs.com (no NPM_TOKEN secret needed)', 'cyan'); |
| 563 | log(' • GITHUB_TOKEN is provided automatically', 'cyan'); |
| 564 | log('\n2. To trigger a release:', 'cyan'); |
| 565 | log(' • Update version in package.json', 'cyan'); |
| 566 | log(' • Update changelog in docs/CHANGELOG.md', 'cyan'); |
| 567 | log(' • Commit and push to main branch', 'cyan'); |
| 568 | log('\n3. Monitor the release workflow in GitHub Actions', 'cyan'); |
| 569 | |
| 570 | return this.errors.length === 0; |
| 571 | } |
| 572 | } |
| 573 | |
| 574 | // Run the tests |
no test coverage detected