eclipse/amlen

jenkins job doesn't fail if build step fails

Opened this issue · 0 comments

There is something wrong in the jenkins job which means that builds that fail (ie the build step in the job fails) do not necessarily cause the job to fail. As long as the files needed in the deploy step have been created then the deploy step will pass and the job will be counted as a success. This is a particular problem when it comes to unit tests as those run after everything needed for deploying run so unit tests failures do not cause the job to fail (or even make it obvious they have failed).

Hopefully something small has been missed in the build step of the jenkinsFile:

amlen/Jenkinsfile

Lines 58 to 76 in 6900d64

stage('Build') {
steps {
echo "In Build, BUILD_LABEL is ${env.BUILD_LABEL}"
container('amlen-centos7-build') {
sh '''
pwd
free -m
cd server_build
bash buildcontainer/build.sh
cd ../operator
NOORIGIN_BRANCH=${GIT_BRANCH#origin/} # turns origin/master into master
export IMG=quay.io/amlen/operator:$NOORIGIN_BRANCH
make bundle
make produce-deployment
'''
}
}
}

Making a unit test fail is fairly easy, however you need to know which ones run standardly in a build so here is a new test that does run:

void testAdminPasswdHash(void)
{
for( int k = 0 ; k < 10 ; k++ ) {
uint64_t rval;
uint8_t * randbuf = (uint8_t *)&rval;
RAND_bytes(randbuf, 8);
char * password = "password";
char * hash = malloc(128 + 1);
ism_security_1wayHashAdminUserPassword(password,(char *)&rval,hash);
char * encoding = malloc(128 + 20 + 5);
sprintf(encoding,"_1:%020lu:%s",rval,hash);
CU_ASSERT(ism_config_confirmAdminUserPassword2("password",encoding));
CU_ASSERT(!ism_config_confirmAdminUserPassword2("password2",encoding));
}
}