mkobit / jenkins-pipeline-shared-library-example

Basic template example of a Jenkins Pipelines Shared Library that is tested using https://github.com/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin
MIT License
70 stars 34 forks source link

Fix integration test #11

Open briancolfer-upstart opened 3 years ago

briancolfer-upstart commented 3 years ago

Starting at line 77 in test/integration/groovy/com/mkobit/libraryexample/ExampleSrcSpockSpec.groovy:

   then:
    // JenkinsRule has different assertion capabilities
    WorkflowRun run = rule.assertBuildStatusSuccess(futureRun)
    rule.assertLogContains('''
        [Pipeline] lock
        Trying to acquire lock on [myLock]
        Resource [myLock] did not exist. Created.
        Lock acquired on [myLock]
    '''.stripIndent(), run)
  }

should be

  then:
    // JenkinsRule has different assertion capabilities
    WorkflowRun run = rule.assertBuildStatusSuccess(futureRun)
    rule.assertLogContains('''
    [Pipeline] lock
    Trying to acquire lock on [myLock]
    Resource [myLock] did not exist. Created.
    Lock acquired on [myLock]
    '''.stripIndent(), run)
  }
tejindrakhatri1 commented 8 months ago

Actually it should be like this: semicolon at the end.

WorkflowRun run = rule.assertBuildStatusSuccess(futureRun); rule.assertLogContains(''' [Pipeline] lock Trying to acquire lock on [myLock] Resource [myLock] did not exist. Created. Lock acquired on [myLock] '''.stripIndent(), run);

tejindrakhatri1 commented 8 months ago

Actually it should be like this: semicolon at the end.

WorkflowRun run = rule.assertBuildStatusSuccess(futureRun); rule.assertLogContains(''' [Pipeline] lock Trying to acquire lock on [myLock] Resource [myLock] did not exist. Created. Lock acquired on [myLock] '''.stripIndent(), run);