Task 8 Backend Design pipeline & description - konlawatit/SWDEV-BBP-PLUS GitHub Wiki

Backend (team-13-backend)

Pull Code

stages {
        stage('Pull Code') {
            steps {
                git branch: 'main', url: 'https://github.com/konlawatit/SWDEV-BBP-PLUS'
            }
        }
  • Stage 1 ทำการดึง Code มาจาก Branch main ของโปรเจค

Download dependency

stage('Download dependency') {
            steps {
                sh 'cd backend && npm install'
            }
        }
  • Stage 2 ทำการดาวน์โหลดและติดตั้ง Dependency ต่าง ๆ ของตัวโปรเจค โดยใช้คำสั่ง cd backend && npm install

Unit testing

stage('Unit Testing') {
            steps {
                sh 'cd backend && npm run unit-test'
            }
        }
  • Stage 3 ทำการทดสอบในรูปแบบของ Unit Test โดยใช้คำสั่ง cd backend && npm run unit-test

Unit Testing Report

stage('Unit Testing Report') {
            steps {
                sh 'cd backend && npm run unit-test-report'
            }
        }
  • Stage 4 ทำการแสดง Unit Test Report โดยใช้คำสั่ง cd backend && npm run unit-test-report

Component testing

stage('Component Testing') {
            steps {
                sh 'cd backend && npm run component-test'
            }
        }
  • Stage 5 ทำการทดสอบในรูปแบบของ Component Test โดยใช้คำสั่ง cd backend && npm run component-test

Component Testing Report

stage('Component Testing Report') {
            steps {
                sh 'cd backend && npm run component-test-report'
            }
        }
  • Stage 6 ทำการแสดง Component Test Report โดยใช้คำสั่ง cd backend && npm run component-test-report

Create Coverage Report

stage('Create Coverage Report') {
            steps {
                echo 'code coverage report'
                // sh ''
                clover(cloverReportDir: 'backend/coverage', cloverReportFileName: 'clover.xml',
                    healthyTarget: [methodCoverage: 70, conditionalCoverage: 80, statementCoverage: 80],
                    unhealthyTarget: [methodCoverage: 50, conditionalCoverage: 50, statementCoverage: 50],
                    failingTarget: [methodCoverage: 0, conditionalCoverage: 0, statementCoverage: 0]
                )
            }
        }
  • Stage 7 ทำการสร้าง Coverage report