Skip to content

spec checking for process returns true by finding the grep as opposed to the CodeDeploy process. #10

Description

@tomharvey

When CodeDeploy is not running:
ps -ax | grep "codedeploy-agent: InstanceAgent" will return:

 7443 pts/0    S+     0:00 grep codedeploy-agent: InstanceAgent

When CodeDeploy is running:
ps -ax | grep "codedeploy-agent: InstanceAgent" will return:

 7679 pts/0    Sl     0:00 codedeploy-agent: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller of master 7675
 7756 pts/0    S+     0:00 grep --color=auto codedeploy-agent: InstanceAgent

And in either case the test at https://github.com/continuousphp/aws-codedeploy-agent/blob/master/test/integration/aws-codedeploy-agent/serverspec/default_spec.rb#L10 will assert true.

A better test would be one which filters out the grep process and only returns the CodeDeploy process if running:

ps -ax | grep "codedeploy-agent: InstanceAgent" | grep -v grep

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions