Gradle to Setup Integration customised Plugin

I was making a gradle task to do a whole bunch of stuff about automatically running integration test.
My process is within a single customised gradle task.
First start moco server with typical command with
’java -jar moco-runner-0.10.2-standalone.jar http -p 12306 -c test_data/b2/versions/b2_moco.json’
After that I’m running a cucumber test(integration test against it)
However the moco server became not responding after sucessfully returning several response. And after that all my integration is telling me 504 error.
Meanwhile. If I run moco server separately and in another task run Integration it works well.
Do you know what might be the root cause for this issue. Thanks!

I’m not familiar with moco, but with getting a 504 http response (which means is indicating a Gateway Timeout) it seems unlikely to be an issue with Gradle here. Can you share how your task is implememted? How do you invoke the server from Gradle and how do you invoke the cucumber tests?

As an additional sidenote I think starting the moco server in a separate task follows best practices imo.


Thanks for replying, Simply speaking, is it possible so far to both start server and run integration test in a single gradle task by ‘gradle taskname’. If could please suggest how to do that. I know there’s some tricky stuff while start server and run IT in the same task… But I do not want to spread those stuff in multiple tasks.