infracloudio / ifc-rw-codecollection

test codebundle for runwhen
Apache License 2.0
0 stars 0 forks source link

Runbook not able to find bash file #8

Closed saurabh3460 closed 5 months ago

saurabh3460 commented 6 months ago

Steps to reproduce:

Build Image

docker build --tag runwhen . --no-cache

Run container with env vars MYSQL_USER_ENV, MYSQL_PASSWORD_ENV, MYSQL_HOST_ENV, PROCESS_USER_ENV required to run run bash script kill-mysql-sleep-processes.sh. These variables are used to pass RDS credentials to runbook.robot

docker run --rm -d -p 3000:3000 --name rds-codecollection \
--network="host" \
-e ENV_PROMETHEUS_HOST="http://ab916f39fadce498ead455d91e808053-1900228415.us-west-2.elb.amazonaws.com/prometheus/api/v1" \
-e ENV_QUERY="aws_rds_database_connections_average{dimension_DBInstanceIdentifier="robotshopmysql"} > 1" \
-e MYSQL_USER_ENV="admin" \
-e MYSQL_PASSWORD_ENV="docb3421z" \
-e MYSQL_HOST_ENV="robotshopmysql.c9m6m4s8zo0.us-west-2.rds.amazonaws.com" \
-e PROCESS_USER_ENV="shipping" \
runwhen:latest

Run runbook.robot

docker exec rds-codecollection bash -c "ro /app/codecollection/codebundles/rds-mysql-conn-count/runbook.robot && ls -R /robot_logs"

 docker exec rds-codecollection bash -c "ro /app/codecollection/codebundles/rds-mysql-conn-count/runbook.robot && ls -R /robot_logs"
[ ERROR ] Error in library 'RW.Core': Adding keyword 'add_datagrid_to_report' failed: Union cannot be empty.
[ ERROR ] Error in library 'RW.Core': Adding keyword 'add_table_to_report' failed: Union cannot be empty.
==============================================================================
Runbook :: This taskset Kills the numbers of sleep process created in MySQL
==============================================================================
Run Bash File :: Runs a bash file to verify script passthrough works  [ WARN ] File 'kill-mysql-sleep-processes.sh' not found in the current directory and current directory is not root.
| FAIL |
FileNotFoundError: [Errno 2] No such file or directory: 'kill-mysql-sleep-processes.sh'
------------------------------------------------------------------------------
Runbook :: This taskset Kills the numbers of sleep process created... | FAIL |
1 task, 0 passed, 1 failed
==============================================================================
Output:  /robot_logs/rds-mysql-conn-count/runbook-output.xml
Log:     /robot_logs/rds-mysql-conn-count/runbook-log.html
Report:  /robot_logs/rds-mysql-conn-count/runbook-report.html
Hashfyre commented 5 months ago

Fixed by: https://github.com/runwhen-contrib/rw-cli-codecollection/pull/301