JUnit in batch mode & Call Workflow Service node

Hi KNIMErs,

I executed testflows in batch mode using the following command line on order to generate JUnit reports

knime.exe -consoleLog -noexit -nosplash -ignoreNodeMessages -application org.knime.testing.NGTestflowRunner -root <Workspace_Path>\POC\Testflows\ -xmlResultDir <Workspace_Path>\POC\Testflows_Reports\

But I got the following error related to the Call Workflow Service node

ERROR KNIME-Worker-0-Call Workflow Service 3:5 Node Execute failed: No such workflow: C:\Users\<username>\AppData\Local\Temp\tempTestRootDirs1402\Testflows\POC\KNIME_project

I do not understand why the node try to execute the KNIME_project workflow using this path since my workspace is located on the D: drive.

For your information:

  • The testflow are working in the Analytics platform 4.6.1 using either the default execution or using “Run as workflow test” option.

  • The path of the Call Workflow Service is equal to /POC/KNIME_project

Do you have any suggestions ?

Furthermore I got a warning message before this error.
WARN Testflow executor (Test_Call_KNIME_project) HadoopInitializer Unable to find 'msvcr100.dll' at hadoop home creation.

Regards,
Joel

Hi KNIMErs,

I update my KNIME Analylics to 4.6.3 and the warning related to the missing dll diseapears, so that’s great :grinning:

I tried to execute in batch mode the Call Service node but using org.knime.product.KNIME_BATCH_APPLICATION instead of org.knime.testing.NGTestflowRunner and I observed that the node does not work with absolute path like /POC/KNIME_project (see error below)

ERROR    KNIME-Worker-0-Call Workflow Service 3:5 Node   Execute failed: Cannot invoke "java.io.File.toPath()" because "mountpointRoot" is null
java.lang.NullPointerException: Cannot invoke "java.io.File.toPath()" because "mountpointRoot" is null

So I modifed the path into a relative one …/…/KNIME_project
The execution suceeded on org.knime.product.KNIME_BATCH_APPLICATION and I was able to print the path using a java snippet.

Therefore I retried to execute the workflow using org.knime.testing.NGTestflowRunner to generate JUnit reports using the same command line but I got another error.

KNIME-Worker-0-Call Workflow Service 3:5 Node Execute failed: Leaving the mount point is not allowed for workflow relative URLs:

Is it normal that using the testing framework I cannot use a relative whereas I can using the application product ?

Regards,
Joel

Hi Joel,

Sorry for coming back to you on this late.
I am happy that the dll issue disappeared with the upgrade.
Unfortunately the headless execution of the workflows (i.e. calling the execution from shell providing the WF as an argument) is not supported by KNIME. You can obviously run it, and most of the times it will work, however we do not test this functionality, so we would discourage our customers using that functionality.
My question would be: what is the use case that forces you to use KNIME this way? With KNIME Server each workflow has a REST endpoint that could be called. Wouldn’t this serve you better?
Could you also elaborate a little more on how does JUnit framework come into the picture. We are really interested to learn about new ways of using/testing KNIME.

Thanks a lot,
Norbert

2 Likes

Hi @nsas,

I am using KNIME this way of testing workflows in order to implement a CI/CD pipeline in GitLab.

I was interested to use the Testing framework since it allows to execute several testflows using a single command line and generate XML test reports for all of them.

At the end I wanted to save them using the artefact GitLab CI/CD feature in order to attach them to the GIT commit.

I didn’t have in mind to use the server since I am interested in the CI process and not on the deployment one.

Regards,
Joel

Hi @joel,

You are on the right path, you should be able to get your workflows running with a little re-configuration.

Leaving the mount point is not allowed for workflow relative URLs:

This error tells us, that you are trying to call a workflow that is outside the Mount Point which, in the case of the NGTestflowRunner is the path you indicate with the -root argument. So if you would point it to <Workspace_Path\POC it could work. I think you only want to run the tests located in the Testflows directory, correct?. You can specify an inclusion pattern with the -include argument followed by a regular expression, e.g. -include "/Testflows.*"

best,
Gabriel

2 Likes

hi @gab1one,

Thanks for the tip, now it works.
I am able to call the workflow to test from the Testflows and generate the XML reports.

Regards,
Joel

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.