Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jenkins job doesn't fail if build step fails #93

Open
IanBoden opened this issue Sep 21, 2022 · 0 comments
Open

jenkins job doesn't fail if build step fails #93

IanBoden opened this issue Sep 21, 2022 · 0 comments
Labels
bug Something isn't working hacktoberfest issues suitable for people to work on in hacktoberfest

Comments

@IanBoden
Copy link
Contributor

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));
}
}

@IanBoden IanBoden added hacktoberfest issues suitable for people to work on in hacktoberfest bug Something isn't working labels Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hacktoberfest issues suitable for people to work on in hacktoberfest
Projects
None yet
Development

No branches or pull requests

1 participant