私はセレンスタンドアロンサーバーを使用して実行する一連のBDDセレンテストを行っています。それらを実行するために、私は、端末(私が正しいディレクトリにいる一度)に次のコードを入力します。Jenkins Execute Shellのビルドステップから "振る舞い"テストをどのように起動させるのですか?
source project/bin/activate # Opens a virtualenv with appropriate interpreters
behave
とテストが行われたとき:
deactivate # Ends the virtualenv
私はジェンキンスプロジェクトを設定しています同じファイルとテストでGitHubリポジトリにアクセスします。プロジェクトには、シェルコマンドを実行するビルドステップがあります。コードがあります:
Started by <user>
Building in workspace /Users/Shared/Jenkins/Home/workspace/Tutorial
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url [email protected]:<url>.git # timeout=10
Fetching upstream changes from [email protected]:<url>.git
> git --version # timeout=10
> git fetch --tags --progress [email protected]:<url>.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision b62c3e873be4fba3daa1b29a9954a130c768a8f4 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f b62c3e873be4fba3daa1b29a9954a130c768a8f4
> git rev-list b62c3e873be4fba3daa1b29a9954a130c768a8f4 # timeout=10
[Tutorial] $ /bin/bash /Users/Shared/Jenkins/tmp/hudson719949293776127111.sh
/Users/Shared/Jenkins/tmp/hudson719949293776127111.sh: line 4: behave: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
私はバリエーションを試してきましたConsole Output
を参照してください。
#!/bin/bash
cd dev #Enter right directory
source project/bin/activate #Activate virtualenv
behave
が、私は次の出力を取得し、プロジェクトをビルドするとき、しかし
Execute Shell Build stepを見ます常に同様の結果を得ているようです。これらのテストを実行するにはどうすればよいですか?
編集:
私も次のコードで振る舞う実行するシェルスクリプト(run.sh)を作成しようとしました:
#!/bin/sh
exec project/bin/behave
をして、ジェンキンスでスクリプトを実行するとしてステップを構築behave
の代わりにコード./run.sh
または私がコメントで言及したバリエーションが、私は同じエラーを取得します。
ジョブでそれを呼び出すときに動作するフルパスを含めてみましたか? – Jacob
@Jacob私は 'source project/bin/behave'というコードを試して、' command not found'というエラーメッセージを受け取りました。 'exec project/bin/behave'と' project/bin/behave'は 'No such file or directory'と' Undefined error:0'エラーを生成しますが、その動作はディレクトリにあります。あなたが気づいていないなら、私はすべてを試しているだけです。 –