Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-10442

PHPUnit tests pass, but builds are listed as "Testless Build"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 3.4.1, 4.0
    • None
    • None
    • None

    Description

      Having only a PHPUnit task I used this PHP file (test/ExampleTest.php):

      class StackTest extends PHPUnit_Framework_TestCase
      {
          public function testEmpty()
          {
              $stack = array();
              $this->assertEmpty($stack);
       
              return $stack;
          }
       
          /**
           * @depends testEmpty
           */
          public function testPush(array $stack)
          {
              array_push($stack, 'foo');
              $this->assertEquals('foo', $stack[count($stack)-1]);
              $this->assertNotEmpty($stack);
       
              return $stack;
          }
       
          /**
           * @depends testPush
           */
          public function testPop(array $stack)
          {
              $this->assertEquals('foo', array_pop($stack));
              $this->assertEmpty($stack);
          }
      }
      

      and after running the plan, I got this phpunit.xml file:

      <?xml version="1.0" encoding="UTF-8"?>
      <testsuites>
        <testsuite name="StackTest" file="/Users/akhachatryan/Atlassian/BambooHome3.3.3/xml-data/build-dir/PROJ1-PLAN1-JOB1/test/ExampleTest.php" tests="3" assertions="5" failures="0" errors="0" time="0.007177">
          <testcase name="testEmpty" class="StackTest" file="/Users/akhachatryan/Atlassian/BambooHome3.3.3/xml-data/build-dir/PROJ1-PLAN1-JOB1/test/ExampleTest.php" line="5" assertions="1" time="0.002043"/>
          <testcase name="testPush" class="StackTest" file="/Users/akhachatryan/Atlassian/BambooHome3.3.3/xml-data/build-dir/PROJ1-PLAN1-JOB1/test/ExampleTest.php" line="16" assertions="2" time="0.004539"/>
          <testcase name="testPop" class="StackTest" file="/Users/akhachatryan/Atlassian/BambooHome3.3.3/xml-data/build-dir/PROJ1-PLAN1-JOB1/test/ExampleTest.php" line="28" assertions="2" time="0.000595"/>
        </testsuite>
      </testsuites>
      

      The tests execute and all tests pass, but on the plan summary screen, all builds are listed as "Testless Build"

      Attachments

        Activity

          People

            pbruski Przemek Bruski
            akhachatryan ArmenA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: