a few hours latter…
with help from post How to achive bash like functionality (e.g. 'ls | grep mystuff') with gradle project.exec?
task setupDBTest(type:Exec, description: 'Setting up test database') {
workingDir 'docs/'
commandLine "sh", "-c", "mysql -u dbuser -pdbuser < dbTest.sql"
}
now working