This is an automated email from the ASF dual-hosted git repository. kpvdr pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-interop-test.git
commit fe5e1877dc4255525743718a89d8e556153a5d0b Author: QIT Development Team <[email protected]> AuthorDate: Wed Jul 15 16:02:07 2026 -0400 Remove Jenkins-specific files from public repository Jenkins configuration moved to internal GitLab repository: https://gitlab.cee.redhat.com/messaging/qpid-interop-test-2.0.git Removed: - Jenkinsfile (contains internal references) - .jenkins/ directory (internal setup docs) - CI_CD_SETUP.md (Jenkins-specific configuration) - CI_CD_INTEGRATION_SUMMARY.md (internal references) Kept public-useful features: - JUnit XML output support (--junit-xml option) - Local testing scripts (scripts/run-ci-locally.sh) - Architecture proposals - README with CI/CD overview The JUnit XML feature remains available for any CI/CD system, not just Jenkins. --- .jenkins/README.md | 190 ---------------------- CI_CD_INTEGRATION_SUMMARY.md | 256 ----------------------------- CI_CD_SETUP.md | 371 ------------------------------------------- Jenkinsfile | 266 ------------------------------- 4 files changed, 1083 deletions(-) diff --git a/.jenkins/README.md b/.jenkins/README.md deleted file mode 100644 index 9243ff3..0000000 --- a/.jenkins/README.md +++ /dev/null @@ -1,190 +0,0 @@ -# Jenkins Configuration for QIT 2.0 - -## Quick Setup - -### 1. Create Jenkins Job - -1. Go to Jenkins → New Item -2. Name: `QIT-2.0-Tests` -3. Type: Pipeline -4. Click OK - -### 2. Configure Pipeline - -**Pipeline Section:** -- Definition: Pipeline script from SCM -- SCM: Git -- Repository URL: `<your-repo-url>` -- Branch Specifier: `*/main` -- Script Path: `Jenkinsfile` - -**Build Triggers:** -- ☑ Poll SCM: `H/15 * * * *` (every 15 minutes) -- Or configure webhook for instant triggers - -**Save** - -### 3. Prepare Jenkins Node - -The node needs these tools installed: - -```bash -# Required -sudo dnf install -y python3.11 docker - -# Python package manager -curl -LsSf https://astral.sh/uv/install.sh | sh - -# Optional (for all shims) -sudo dnf install -y nodejs cmake gcc-c++ dotnet-sdk-8.0 java-11-openjdk-devel maven - -# Enable Docker -sudo systemctl enable --now docker -sudo usermod -aG docker jenkins -sudo systemctl restart jenkins -``` - -### 4. Run First Build - -1. Go to job page -2. Click "Build Now" -3. Watch console output -4. Check test results after completion - -## Pipeline Overview - -``` -Preparation (10s) - ↓ -Setup Python (20s) - ↓ -Build Shims - Parallel (60s) -├─ JavaScript (npm install) -├─ C++ (cmake + make) -├─ .NET (dotnet build) -└─ Java (mvn package) - ↓ -Start Broker (15s) - ↓ -Run Tests (10 min) - ↓ -Publish Results & Cleanup -``` - -**Total Duration**: ~12-15 minutes - -## Viewing Results - -### Test Results Tab -- Click on build → Test Results -- See 450 test cases organized by shim pairs -- Drill down into failures -- View trends across builds - -### Console Output -- Full execution log -- Build output from each shim -- Test execution details -- Failure information - -### Artifacts -- `test-results/qit-results.xml` - JUnit XML report -- Preserved for 30 builds - -## Customization - -### Run Subset of Tests - -Edit the "Run Tests" stage in Jenkinsfile: - -```groovy -// Test only Python and C++ -qit test amqp-types \ - --sender python-proton cpp-proton \ - --receiver python-proton cpp-proton \ - --junit-xml ${TEST_RESULTS_DIR}/qit-results.xml -``` - -### Add Parameters - -Add to Jenkinsfile before stages: - -```groovy -parameters { - choice( - name: 'TEST_SCOPE', - choices: ['full', 'smoke'], - description: 'Which tests to run' - ) -} -``` - -Use in stage: -```groovy -script { - if (params.TEST_SCOPE == 'smoke') { - sh 'qit test amqp-types --type int string boolean' - } else { - sh 'qit test amqp-types' - } -} -``` - -### Notifications - -Add to `post` section: - -```groovy -post { - failure { - emailext( - subject: "QIT Tests Failed: ${env.JOB_NAME} #${env.BUILD_NUMBER}", - body: "Check ${env.BUILD_URL}", - to: '[email protected]' - ) - } -} -``` - -## Troubleshooting - -### Build Fails Immediately -- Check node has required tools -- Verify Docker is running and jenkins user is in docker group - -### Shim Builds Fail -- Check console output for specific errors -- Verify build tools are installed -- Pipeline gracefully skips missing tools - -### Tests Timeout -- Check broker is healthy: `docker logs qit-artemis` -- Increase timeout in Jenkinsfile -- Run subset of tests - -### No Test Results -- Check `test-results/*.xml` was created -- Verify JUnit plugin is installed -- Check console for XML generation errors - -## Monitoring - -### Health Checks -- Pass rate should stay ~80% -- Duration should stay ~10-15 minutes -- Watch for flaky tests in trends - -### When to Investigate -- Pass rate drops below 75% -- Duration increases significantly -- New failures appear consistently - -## Next Steps - -1. ✅ Create and configure job -2. ✅ Run successful build -3. Set up notifications -4. Add to PR workflow -5. Monitor trends - -See [CI_CD_SETUP.md](../CI_CD_SETUP.md) for complete documentation. diff --git a/CI_CD_INTEGRATION_SUMMARY.md b/CI_CD_INTEGRATION_SUMMARY.md deleted file mode 100644 index faa45b9..0000000 --- a/CI_CD_INTEGRATION_SUMMARY.md +++ /dev/null @@ -1,256 +0,0 @@ -# QIT 2.0 - CI/CD Integration Complete - -**Date**: 2026-07-15 -**Status**: ✅ Complete and tested - -## Summary - -Successfully implemented complete CI/CD integration for QIT 2.0, enabling automated testing of AMQP interoperability across all 5 client shims. - -## What Was Delivered - -### 1. JUnit XML Reporting ✅ -- **File**: `src/qit/core/orchestrator.py` (new method `generate_junit_xml()`) -- **CLI Option**: `--junit-xml <path>` -- **Features**: - - Standard JUnit XML format for Jenkins/CI tools - - Detailed failure information with message diffs - - Test duration tracking - - Proper test case organization by shim pairs -- **Tested**: ✅ Verified with passing and failing tests - -### 2. Jenkins Pipeline ✅ -- **File**: `Jenkinsfile` -- **Type**: Declarative Pipeline -- **Stages**: - 1. Preparation - Environment checks - 2. Setup Python - Virtual environment and dependencies - 3. Build Shims - Parallel builds (JS, C++, .NET, Java) - 4. Start Broker - Docker Compose automation - 5. Run Tests - Full 450-test matrix - 6. Post Actions - Publish results and cleanup -- **Features**: - - Parallel shim builds for speed - - Graceful handling of missing build tools - - Automatic broker lifecycle management - - JUnit test result publishing - - Test artifact archiving - - Build retention policy (30 builds) - - Timeout protection (30 minutes) - -### 3. Documentation ✅ -- **CI_CD_SETUP.md**: Complete setup guide - - Jenkins job configuration - - Node prerequisites - - Pipeline stages explanation - - Troubleshooting guide - - Advanced configuration options -- **.jenkins/README.md**: Quick reference - - Fast setup steps - - Common customizations - - Health monitoring tips -- **README.md**: Updated with CI/CD section - -### 4. Local Testing Script ✅ -- **File**: `scripts/run-ci-locally.sh` -- **Purpose**: Simulate CI pipeline locally -- **Features**: - - Checks all prerequisites - - Builds all shims - - Manages broker lifecycle - - Runs full test suite - - Generates JUnit XML - - Color-coded output - - Proper error handling - -## Test Results - -### JUnit XML Output Verified -```xml -<testsuite name="QIT AMQP Interoperability Tests" tests="1" failures="1" ...> - <testcase classname="qit.python-proton.javascript-rhea" name="long" time="0.279"> - <failure message="4 message difference(s)" type="InteroperabilityFailure"> -Message Differences (4 total): - - Message 0: value mismatch for type long - - Message 3: value mismatch for type long - - Message 13: value mismatch for type long - - Message 14: value mismatch for type long - </failure> - </testcase> -</testsuite> -``` - -✅ Passing tests -✅ Failing tests with detailed diff information -✅ Proper timing data -✅ Standard Jenkins-compatible format - -## Usage - -### Command Line -```bash -# Full test suite with JUnit output -qit test amqp-types --junit-xml test-results/results.xml - -# Subset of tests -qit test amqp-types \ - --sender python-proton cpp-proton \ - --receiver python-proton cpp-proton \ - --type int string boolean \ - --junit-xml test-results/results.xml -``` - -### Local CI Simulation -```bash -./scripts/run-ci-locally.sh -``` - -### Jenkins Setup -1. Create new Pipeline job: `QIT-2.0-Tests` -2. Configure: Pipeline script from SCM → Git → `Jenkinsfile` -3. Set poll trigger: `H/15 * * * *` -4. Save and run - -## Pipeline Performance - -**Estimated Duration**: 10-15 minutes - -| Stage | Duration | Notes | -|-------|----------|-------| -| Preparation | 10s | Environment checks | -| Setup Python | 20s | Virtual env + dependencies | -| Build Shims | 60s | Parallel builds (4 shims) | -| Start Broker | 15s | Docker Compose | -| Run Tests | 10 min | 450 test cases | -| Cleanup | 10s | Stop broker, prune Docker | - -**Total**: ~12 minutes average - -## Jenkins Node Requirements - -### Required (minimal setup) -- Docker -- Python 3.11+ -- uv (or pip) - -### Optional (full coverage) -- Node.js 18+ (JavaScript shim) -- CMake + GCC (C++ shim) -- .NET SDK 8.0 (.NET shim) -- Java 11+ + Maven (Java shim) - -**Note**: Pipeline gracefully skips shims when build tools are missing. - -## Integration Benefits - -### For Developers -- ✅ Run full test suite locally with one command -- ✅ JUnit XML for local CI tools -- ✅ Fast feedback on changes -- ✅ Pre-flight checks before pushing - -### For CI/CD -- ✅ Automated regression testing -- ✅ Test result trending over time -- ✅ Flaky test detection -- ✅ Build artifact preservation -- ✅ Email/Slack notifications (configurable) - -### For Teams -- ✅ Consistent test execution -- ✅ Historical test data -- ✅ Clear pass/fail status -- ✅ Detailed failure reports -- ✅ No manual broker setup - -## Files Created/Modified - -### New Files -- `Jenkinsfile` - Pipeline definition -- `CI_CD_SETUP.md` - Complete setup documentation -- `.jenkins/README.md` - Quick reference -- `scripts/run-ci-locally.sh` - Local CI simulation -- `CI_CD_INTEGRATION_SUMMARY.md` - This file - -### Modified Files -- `src/qit/core/orchestrator.py` - Added `generate_junit_xml()` method -- `src/qit/cli/main.py` - Added `--junit-xml` option -- `README.md` - Added CI/CD section - -### Test Artifacts -- `test-results/test-run.xml` - Example JUnit XML (passing tests) -- `test-results/test-failure.xml` - Example JUnit XML (failing test) - -## Next Steps for Deployment - -### 1. Set Up Jenkins Job (5 minutes) -Follow `.jenkins/README.md` to create the pipeline job. - -### 2. Configure Jenkins Node (10-30 minutes) -Install required tools on the Jenkins agent: -```bash -sudo dnf install -y python3.11 docker nodejs cmake gcc-c++ dotnet-sdk-8.0 java-11-openjdk-devel maven -curl -LsSf https://astral.sh/uv/install.sh | sh -sudo usermod -aG docker jenkins -``` - -### 3. Run First Build (15 minutes) -- Trigger manual build -- Verify all stages pass -- Check test results -- Review artifacts - -### 4. Configure Notifications (5 minutes) -Add email/Slack notifications for failures (see CI_CD_SETUP.md). - -### 5. Add to PR Workflow (optional) -Configure GitHub/GitLab webhooks to trigger on PR creation/updates. - -## Coexistence with QIT 1.0 - -✅ **No conflicts** - This is a separate pipeline for QIT 2.0 tests -✅ QIT 1.0 Jenkins jobs continue running unchanged -✅ Different test suites, different results -✅ QIT 1.0 can be deprecated/removed at any time - -## Success Criteria - All Met ✅ - -- ✅ JUnit XML output working -- ✅ Jenkins pipeline defined -- ✅ All pipeline stages tested locally -- ✅ Documentation complete -- ✅ Local simulation script working -- ✅ Both passing and failing test cases verified -- ✅ No dependencies on QIT 1.0 -- ✅ Graceful handling of missing tools - -## Comparison: Before vs After - -| Feature | Before | After | -|---------|--------|-------| -| **Test Execution** | Manual | Automated | -| **Broker Setup** | Manual | Automated | -| **Shim Builds** | Manual | Automated + Parallel | -| **Test Results** | Console only | JUnit XML + Trends | -| **Failure Analysis** | Console scroll | Structured diffs | -| **Regression Detection** | Manual | Automatic | -| **Historical Data** | None | 30 builds retained | -| **Notifications** | None | Configurable | - -## Conclusion - -QIT 2.0 now has **production-grade CI/CD integration** that: -- Automates the entire test workflow -- Provides rich test reporting for Jenkins -- Enables regression detection and trending -- Works with or without full build tool stack -- Can be tested locally before pushing -- Coexists with existing QIT 1.0 pipeline - -**Status**: ✅ Ready for Jenkins deployment -**Effort**: ~2 hours implementation + testing -**Value**: High - continuous quality assurance - ---- - -**Next Recommended Action**: Set up Jenkins job and run first automated build diff --git a/CI_CD_SETUP.md b/CI_CD_SETUP.md deleted file mode 100644 index fb8a777..0000000 --- a/CI_CD_SETUP.md +++ /dev/null @@ -1,371 +0,0 @@ -# QIT 2.0 - CI/CD Setup Guide - -## Overview - -QIT 2.0 includes a complete Jenkins pipeline for automated testing of AMQP interoperability across all supported client shims. - -**Pipeline Features:** -- ✅ Automated shim builds (C++, .NET, Java, JavaScript) -- ✅ Dockerized broker management (Apache Artemis) -- ✅ Full test matrix execution (450 tests across 5 shims) -- ✅ JUnit XML reporting -- ✅ Test result trending and analysis -- ✅ Parallel shim builds -- ✅ Automatic cleanup - -## Jenkins Pipeline - -### Location -- **Jenkinsfile**: `./Jenkinsfile` -- **Pipeline Type**: Declarative Pipeline -- **Estimated Duration**: 10-15 minutes - -### Pipeline Stages - -1. **Preparation** (~10 seconds) - - Checks prerequisites (Python, Docker, build tools) - - Creates test results directory - - Displays environment info - -2. **Setup Python Environment** (~20 seconds) - - Creates virtual environment with `uv` - - Installs QIT framework and dependencies - - Verifies installation - -3. **Build Shims** (~30-60 seconds, parallel) - - **JavaScript**: `npm install` - - **C++**: `cmake + make` - - **.NET**: `dotnet build` - - **Java**: `mvn package` - - Builds run in parallel for speed - - Gracefully skips missing build tools - -4. **Start Broker** (~15 seconds) - - Stops any existing broker - - Starts Apache Artemis via Docker Compose - - Waits for broker readiness - - Verifies broker is healthy - -5. **Run Tests** (~10 minutes) - - Executes full 450-test matrix - - Generates JUnit XML report - - Captures detailed failure information - -6. **Post Actions** (always runs) - - Publishes JUnit test results to Jenkins - - Archives test artifacts - - Stops broker - - Cleans up Docker resources - -### Jenkins Configuration - -#### Create the Pipeline Job - -1. **In Jenkins UI:** - - New Item → Pipeline - - Name: `QIT-2.0-Tests` - - Pipeline definition: Pipeline script from SCM - -2. **Configure SCM:** - - SCM: Git - - Repository URL: `<your-git-repo-url>` - - Branch: `*/main` (or your branch) - - Script Path: `Jenkinsfile` - -3. **Build Triggers:** - - Poll SCM: `H/15 * * * *` (check every 15 minutes) - - Or webhook trigger on push - -4. **Build Parameters** (optional): - ``` - String: SENDER_SHIMS (default: all) - String: RECEIVER_SHIMS (default: all) - String: AMQP_TYPES (default: all) - ``` - -#### Required Plugins -- **Pipeline**: Core pipeline support -- **JUnit**: Test result publishing -- **AnsiColor**: Color console output -- **Timestamper**: Timestamps in logs -- **Docker Pipeline**: Docker support (if needed) - -### Node Requirements - -The Jenkins agent/node must have: - -#### Required -- **Docker**: For broker management -- **Python 3.11+**: Framework runtime -- **uv** (or pip): Python package management - -#### Optional (for full coverage) -- **Node.js 18+**: JavaScript shim -- **CMake + C++ compiler**: C++ shim -- **.NET SDK 8.0+**: .NET shim -- **Java 11+ + Maven**: Java shim - -**Note**: The pipeline gracefully skips shims if build tools are missing. - -### Setup Node with All Tools - -```bash -# Fedora/RHEL -sudo dnf install -y \ - python3.11 \ - docker \ - nodejs \ - cmake \ - gcc-c++ \ - dotnet-sdk-8.0 \ - java-11-openjdk-devel \ - maven - -# Install uv -curl -LsSf https://astral.sh/uv/install.sh | sh - -# Enable Docker -sudo systemctl enable --now docker -sudo usermod -aG docker jenkins -``` - -## JUnit XML Output - -### Command-Line Usage - -```bash -# Generate JUnit XML report -qit test amqp-types --junit-xml test-results.xml - -# With specific shims -qit test amqp-types \ - --sender python-proton cpp-proton \ - --receiver python-proton cpp-proton \ - --junit-xml test-results.xml -``` - -### XML Format - -The JUnit XML report includes: -- **Test Suite**: QIT AMQP Interoperability Tests -- **Test Cases**: One per sender/receiver/type combination -- **Class Name**: `qit.{sender}.{receiver}` -- **Test Name**: `{amqp_type}` -- **Time**: Duration in seconds -- **Failures**: Detailed diff information - -Example: -```xml -<testsuite name="QIT AMQP Interoperability Tests" tests="450" failures="89" errors="0"> - <testcase classname="qit.python-proton.cpp-proton" name="int" time="0.052"/> - <testcase classname="qit.python-proton.javascript-rhea" name="long" time="0.048"> - <failure message="4 message difference(s)" type="InteroperabilityFailure"> - Error: 64-bit integer overflow - Message Differences (4 total): - - Message 0: value mismatch for type long - - Message 3: value mismatch for type long - </failure> - </testcase> -</testsuite> -``` - -### Jenkins Integration - -Jenkins automatically: -- Parses JUnit XML files -- Displays pass/fail trends over builds -- Shows test duration graphs -- Provides drill-down into failures -- Tracks flaky tests - -## Advanced Configuration - -### Environment Variables - -Set in Jenkins job configuration or `Jenkinsfile`: - -```groovy -environment { - // Override broker URL - BROKER_URL = 'amqp://artemis.example.com:5672' - - // Test subset - SENDER_SHIMS = 'python-proton,cpp-proton' - RECEIVER_SHIMS = 'python-proton,cpp-proton' - AMQP_TYPES = 'int,string,binary' - - // Timeout - TEST_TIMEOUT = '20' // minutes -} -``` - -### Parameterized Builds - -Add parameters to the pipeline: - -```groovy -parameters { - choice( - name: 'TEST_SCOPE', - choices: ['full', 'smoke', 'regression'], - description: 'Test scope to run' - ) - booleanParam( - name: 'SKIP_BROKER_CLEANUP', - defaultValue: false, - description: 'Keep broker running after tests' - ) -} -``` - -### Parallel Testing - -For faster execution, split tests by shim or type: - -```groovy -stage('Run Tests') { - parallel { - stage('Test Python') { - steps { - sh 'qit test amqp-types --sender python-proton --receiver python-proton' - } - } - stage('Test C++') { - steps { - sh 'qit test amqp-types --sender cpp-proton --receiver cpp-proton' - } - } - // etc. - } -} -``` - -### Notifications - -Add Slack/email notifications: - -```groovy -post { - failure { - mail to: '[email protected]', - subject: "QIT 2.0 Tests Failed: ${env.JOB_NAME} #${env.BUILD_NUMBER}", - body: "Check console output at ${env.BUILD_URL}" - } -} -``` - -## Monitoring and Debugging - -### View Test Results - -**Jenkins UI:** -1. Build → Test Results -2. See pass/fail by test case -3. Drill down to failure details -4. View trends across builds - -**Console Output:** -- Full test execution log -- Shim build output -- Broker startup logs -- Test failure details - -### Common Issues - -#### 1. Broker Won't Start -``` -Error: docker compose up failed -``` -**Solution**: Check Docker daemon is running, ports aren't in use -```bash -sudo systemctl start docker -docker ps # check for port 5672 conflicts -``` - -#### 2. Shim Build Fails -``` -Error: cmake: command not found -``` -**Solution**: Install missing build tools or update Jenkinsfile to skip -```bash -sudo dnf install cmake gcc-c++ -``` - -#### 3. Tests Timeout -``` -Error: Receive failed: timeout -``` -**Solution**: Increase timeout, check broker health -```bash -docker logs qit-artemis # check broker logs -``` - -#### 4. Permission Denied -``` -Error: Got permission denied while trying to connect to Docker -``` -**Solution**: Add jenkins user to docker group -```bash -sudo usermod -aG docker jenkins -sudo systemctl restart jenkins -``` - -## Performance Optimization - -### Reduce Test Time - -1. **Run subset for quick feedback:** - ```bash - qit test amqp-types --type int,string,boolean - ``` - -2. **Test only modified shims:** - ```bash - qit test amqp-types --sender python-proton --receiver python-proton - ``` - -3. **Use test result caching:** - - Jenkins caches Docker images - - Reuse Python virtual environment - - Skip clean builds when possible - -### Resource Optimization - -- **CPU**: Parallel shim builds use all cores -- **Memory**: ~2GB for full test suite -- **Disk**: ~500MB for Docker images + artifacts -- **Network**: Local broker (no external dependencies) - -## Comparison: Old vs New Pipeline - -| Feature | QIT 1.0 | QIT 2.0 | -|---------|---------|---------| -| **Test Count** | ~50 | 450 | -| **Languages** | 2-3 | 5 | -| **Duration** | 15 min | 10-15 min | -| **Reporting** | Basic | JUnit XML + Trends | -| **Broker** | Manual | Automated (Docker) | -| **Shim Builds** | Manual | Automated + Parallel | -| **Failure Details** | Limited | Comprehensive diffs | -| **CI/CD Ready** | Partial | Complete | - -## Next Steps - -1. **Set up Jenkins job** using instructions above -2. **Run first build** to verify setup -3. **Review test results** and establish baseline -4. **Configure notifications** for failures -5. **Add to PR workflow** for regression testing - -## Support - -For issues or questions: -- Check Jenkins console output -- Review `test-results/qit-results.xml` -- Check broker logs: `docker logs qit-artemis` -- See `README.md` for QIT framework details - ---- - -**Status**: ✅ Production Ready -**Last Updated**: 2026-07-15 diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index fe28ddd..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,266 +0,0 @@ -#!/usr/bin/env groovy - -/** - * QIT 2.0 - Jenkins Pipeline - * - * This pipeline runs the AMQP Interoperability Test Suite across all supported - * client shims (Python, JavaScript, C++, .NET, Java). - * - * Requirements: - * - Docker (for broker) - * - Python 3.11+ - * - uv (Python package manager) - * - Node.js 18+ (for JavaScript shim) - * - CMake + C++ compiler (for C++ shim) - * - .NET SDK 8.0+ (for .NET shim) - * - Java 11+ + Maven (for Java shim) - */ - -pipeline { - agent any - - options { - // Keep last 30 builds - buildDiscarder(logRotator(numToKeepStr: '30')) - // Timeout after 30 minutes - timeout(time: 30, unit: 'MINUTES') - // Timestamps in console output - timestamps() - // ANSI color in console output - ansiColor('xterm') - } - - environment { - // Python virtual environment - VENV_DIR = '.venv' - // Test results directory - TEST_RESULTS_DIR = 'test-results' - // Docker compose file for broker - COMPOSE_FILE = 'docker/compose.yaml' - // QIT version - QIT_VERSION = '2.0.0' - } - - stages { - stage('Preparation') { - steps { - script { - echo "======================================" - echo "QIT ${QIT_VERSION} - Pipeline Started" - echo "======================================" - echo "Build: ${env.BUILD_NUMBER}" - echo "Job: ${env.JOB_NAME}" - echo "Node: ${env.NODE_NAME}" - } - - // Clean previous test results - sh "rm -rf ${TEST_RESULTS_DIR}" - sh "mkdir -p ${TEST_RESULTS_DIR}" - - // Check prerequisites - sh ''' - echo "Checking prerequisites..." - python3 --version - uv --version || echo "WARNING: uv not found, will use pip" - docker --version - node --version || echo "WARNING: Node.js not found (JavaScript shim will be skipped)" - cmake --version || echo "WARNING: CMake not found (C++ shim will be skipped)" - dotnet --version || echo "WARNING: .NET SDK not found (.NET shim will be skipped)" - java -version || echo "WARNING: Java not found (Java shim will be skipped)" - ''' - } - } - - stage('Setup Python Environment') { - steps { - echo "Setting up Python environment..." - sh ''' - # Create virtual environment - if command -v uv &> /dev/null; then - uv venv - . ${VENV_DIR}/bin/activate - uv sync - else - python3 -m venv ${VENV_DIR} - . ${VENV_DIR}/bin/activate - pip install -e . - fi - - # Verify installation - . ${VENV_DIR}/bin/activate - qit --version - ''' - } - } - - stage('Build Shims') { - parallel { - stage('Build JavaScript Shim') { - when { - expression { - return fileExists('shims/javascript-rhea/package.json') - } - } - steps { - echo "Building JavaScript/Rhea shim..." - dir('shims/javascript-rhea') { - sh ''' - if command -v npm &> /dev/null; then - npm install - echo "✓ JavaScript shim ready" - else - echo "⚠ Node.js not available, skipping JavaScript shim" - exit 0 - fi - ''' - } - } - } - - stage('Build C++ Shim') { - when { - expression { - return fileExists('shims/cpp-proton/CMakeLists.txt') - } - } - steps { - echo "Building C++ Proton shim..." - dir('shims/cpp-proton') { - sh ''' - if command -v cmake &> /dev/null; then - mkdir -p build - cd build - cmake .. - make -j$(nproc) - echo "✓ C++ shim ready" - else - echo "⚠ CMake not available, skipping C++ shim" - exit 0 - fi - ''' - } - } - } - - stage('Build .NET Shim') { - when { - expression { - return fileExists('shims/dotnet-proton/QitShim.csproj') - } - } - steps { - echo "Building .NET Proton shim..." - dir('shims/dotnet-proton') { - sh ''' - if command -v dotnet &> /dev/null; then - dotnet restore - dotnet build -c Release - echo "✓ .NET shim ready" - else - echo "⚠ .NET SDK not available, skipping .NET shim" - exit 0 - fi - ''' - } - } - } - - stage('Build Java Shim') { - when { - expression { - return fileExists('shims/java-protonj2/pom.xml') - } - } - steps { - echo "Building Java ProtonJ2 shim..." - dir('shims/java-protonj2') { - sh ''' - if command -v mvn &> /dev/null; then - mvn clean package -DskipTests - echo "✓ Java shim ready" - else - echo "⚠ Maven not available, skipping Java shim" - exit 0 - fi - ''' - } - } - } - } - } - - stage('Start Broker') { - steps { - echo "Starting Apache Artemis broker..." - sh ''' - # Stop any existing broker - docker compose -f ${COMPOSE_FILE} down || true - - # Start broker - docker compose -f ${COMPOSE_FILE} up -d - - # Wait for broker to be ready - echo "Waiting for broker to be ready..." - sleep 10 - - # Verify broker is running - docker compose -f ${COMPOSE_FILE} ps - - echo "✓ Broker ready" - ''' - } - } - - stage('Run Tests') { - steps { - echo "Running QIT 2.0 test suite..." - sh ''' - . ${VENV_DIR}/bin/activate - - # Run full test matrix with JUnit XML output - qit test amqp-types \\ - --broker amqp://localhost:5672 \\ - --junit-xml ${TEST_RESULTS_DIR}/qit-results.xml \\ - || EXIT_CODE=$? - - # Exit with test result code - exit ${EXIT_CODE:-0} - ''' - } - } - } - - post { - always { - // Publish JUnit test results - junit testResults: "${TEST_RESULTS_DIR}/*.xml", allowEmptyResults: true - - // Archive test artifacts - archiveArtifacts artifacts: "${TEST_RESULTS_DIR}/**/*", allowEmptyArchive: true - - // Stop broker - sh ''' - echo "Stopping broker..." - docker compose -f ${COMPOSE_FILE} down || true - ''' - - // Cleanup - sh ''' - echo "Cleaning up Docker resources..." - docker system prune -f --volumes || true - ''' - } - - success { - echo "✓ QIT 2.0 Tests PASSED!" - } - - failure { - echo "✗ QIT 2.0 Tests FAILED" - } - - unstable { - echo "⚠ QIT 2.0 Tests UNSTABLE" - } - } -} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
