Open stephenkinder opened 4 years ago
In case anyone is interested, we have a doc that shows how to create a pipeline that includes test task for nodejs-express, spring, and microprofile here https://ibm-cloud-architecture.github.io/Learning-Kabanero-101/web/1.0.0/tekton-create-pipeline.html
The only thing is that the container image for the test needs to be hardcoded at the creating of the task:
@csantanapr commented on Fri Oct 11 2019
Is your feature request related to a problem? Please describe. Problem is that I think the default pipeline which includes 2 tasks
build
anddeploy
should have a 3rd task that runs the same process asappsody test
Describe the solution you'd like
test-task
should be first in the pipeline..appsody-config.yaml
from the git source For example nodejs:/project
$APPSODY_INSTALL
and$APPSODY_TEST
Describe alternatives you've considered I have something working for
nodejs-express
but I hit a few problems.Some of the problems I hit: . hardcoding the image name
kabanero/nodejs-express:0.2
this should be from the config file.appsody-config.yaml
. something weird about running
$APPSODY_TEST
with the value isnpm test && npm test -- prefix user-app
mocha tries to parse&&
as argument, so the workaround I did was to parse the variable and execute it. I really wanted to avoid to run appsody extract, this takes too much time when using a volume, so I tried to do a softlink to avoid the
cp -a
, withln -s /workspace/git-source /project/user-app
the files get map correctly, the problem is with node.js when it tries to resolve node dependencies thecd ..
get's resolve into/workspace
instead of/project
I guess we can add the appsody extract at this stage, and remove it from thebuild-task
I'm going to look into spring-boot and microprofile appsody stacks to implement the unit test tasks.
Additional context Tekton should have a way to dynamically specify the image name for step in a task some how, this way we don't need to hardcode
kabanero/nodejs-express:0.2
cc @seabaylea
@csantanapr commented on Fri Oct 11 2019
In case is useful to anyone doing tekton task development and debugging, I'm using the tekton
tkn
CLI to simulate the same pipelinerun that get's trigger thru git webhookresources:
@csantanapr commented on Fri Oct 11 2019
Here is the log output, as you can see if running the mocha tests from the
/project
directory and second run on the/project/user-app
output
@csantanapr commented on Fri Oct 11 2019
Here how they look in tekton dashboard of ICP4Apps v3
One weird thing, they run in the correct order test(1), build(2), deploy(3) but the rows in the UI doesn't show them like this when the pipelinerun is completed.
@csantanapr commented on Fri Oct 11 2019
Here is how my test pipeline resource looks like