Continuous integration playframework自动测试Jenkins CI是否等待完成?

Continuous integration playframework自动测试Jenkins CI是否等待完成?,continuous-integration,playframework,jenkins,Continuous Integration,Playframework,Jenkins,我正在尝试为playframework.org应用程序设置Jenkins CI,但在运行自动测试命令后正确启动play时遇到问题 测试运行正常,但我的脚本似乎同时启动了play auto test和play start--%ci。当播放开始--%ci命令运行时,它会得到一个pid和所有信息,但它没有运行 文件:auto-test.sh,jenkins使用ExecuteShell运行此文件 #/bin/bash #pwd是詹金斯工作区主任 #改为Approt目录 cd客户门户; #取消之前的任何游

我正在尝试为playframework.org应用程序设置Jenkins CI,但在运行自动测试命令后正确启动play时遇到问题

测试运行正常,但我的脚本似乎同时启动了
play auto test
play start--%ci
。当
播放开始--%ci
命令运行时,它会得到一个pid和所有信息,但它没有运行

文件:auto-test.sh,jenkins使用ExecuteShell运行此文件
#/bin/bash
#pwd是詹金斯工作区主任
#改为Approt目录
cd客户门户;
#取消之前的任何游戏发布
如果[-e“server.pid”]
然后
杀死'cat server.pid';
rm-rfserver.pid;
fi
#删除并重新创建数据库
mysql--user=user--password=PASS--host=HOSTNAME<../setupdb.sql
#自动测试最新版本
/usr/local/lib/play/play自动测试;
#这不足以等待自动测试完成吗?
#如何等待实际流程完成?
#睡眠60;
等待
#基于测试的条件启动
#通过时启动正常,失败时测试
#
如果[-e”“/test result/result.passed”]
然后
/usr/local/lib/play/play start--%ci;
出口0;
其他的
/usr/本地/lib/播放/播放测试;
出口1;
fi

也许睡眠时间不够

尝试改用
等待
。您可以指定
play auto test
的PID(如果可以获得),或者要求它等待所有后台进程结束


看这里:

也许你可以试试詹金斯插件玩!框架

看这里(我已经解决了关于詹金斯和游戏的问题!):


这里:

谢谢,但我仍然看到等待的行为;如果没有参数,则不确定如何获取pid进行自动测试,但将尝试从ps aux grep magic工作。如果尝试
wait${!}
,则不需要pid。它将等待所有后台进程完成,因此它应该自动等待play auto Test,这似乎是我缺乏bash脚本技巧的一个问题,而不是其他任何问题……看起来构建脚本没有终止,基本上像在前台运行一样坐着等待。我让Jenkins控制台的输出显示了一个正在运行的应用程序的持久日志!不好…“播放测试”-->“播放测试应用程序名称--%test”,因此它在后台运行。
#!/bin/bash
# pwd is jenkins workspace dir
# change into approot dir
cd customer-portal;

# kill any previous play launches
if [ -e "server.pid" ]
then
    kill `cat server.pid`;
    rm -rf server.pid;
fi

# drop and re-create the DB
mysql --user=USER --password=PASS --host=HOSTNAME < ../setupdb.sql

# auto-test the most recent build
/usr/local/lib/play/play auto-test;

# this is inadequate for waiting for auto-test to complete?
# how to wait for actual process completion?
# sleep 60;
wait;

# Conditional start based on tests
# Launch normal on pass, test on fail
#
if [ -e "./test-result/result.passed" ]
then
    /usr/local/lib/play/play start --%ci;
    exit 0;
else
    /usr/local/lib/play/play test;
    exit 1;
fi