aboutsummaryrefslogtreecommitdiffstats
path: root/Jenkinsfile
blob: 6bcb8014f420b3a5b760653b95bc97a374440ed1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
properties([
    pipelineTriggers([cron('H * * * *')])
])
node {
    checkout scm
    def packages = ["python_moonutilities","python_moondb","python_moonclient","moon_manager","moon_wrapper","moon_authz","moon_interface","moon_orchestrator"]
    def subtests = [:]
    for (x in packages) {
        def pkg = x
        subtests[pkg] = {
            withDockerContainer('wukongsun/moon_python_unit_test') {
            stage("Install prerequisites for package ${pkg}") {
                sh("pip install pytest requests_mock requests --upgrade")
                    sh("cd ${pkg} && pip install -r tests/unit_python/requirements.txt && pip install .")
                }
                stage("Unit test for package ${pkg}") {
                    sh "cd ${pkg}/tests/unit_python && pytest ."
                }
            }
        }
    }
    parallel subtests
}