Skip to content

Step that runs "swift test" in the local directory and export the results into Bitrise Test Plugin with code coverage

License

Notifications You must be signed in to change notification settings

igorcferreira/bitrise-step-run-spm-test-with-coverage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run Swift Test Build Status

This step uses xcodebuild & xcpretty to run the macOS tests for the Swift Package Manager. The final files are output in a structure compatible with the "Test Report" plugin and can be configured to be JUnit or HTML as output, so the generated files are compatible with tools like Danger.

The Code coverage is always exported as a JSON file.

How to use this Step

- git::https://github.com/igorcferreira/bitrise-step-run-spm-test-with-coverage.git@main:
   title: Run Swift Package Manager Tests
   inputs:
   - TEST_NAME: BitriseTest
   - PROJECT_DIR: $BITRISE_SOURCE_DIR
   - SKIP_BUILD: 'NO'
   - REPORTER: junit

This step will run the package tests and expose the test result and code coverage on:

  • TEST_RESULT: XML file with the result of the tests
  • CODE_COVERAGE_RESULT: JSON file with the result of the code coverage report

Supported platforms

By default, the tests will run on macOS, but a different sdk can be selected by changing the SDK and DESTINATION inputs. Example:

- git::https://github.com/igorcferreira/bitrise-step-run-spm-test-with-coverage.git@main:
   title: Run Swift Package Manager Tests
   inputs:
   - TEST_NAME: BitriseTest
   - PROJECT_DIR: $BITRISE_SOURCE_DIR
   - SKIP_BUILD: 'NO'
   - REPORTER: junit
   - SDK: 'iphonesimulator'
   - DESTINATION: 'platform=iOS Simulator,name=iPhone 8 Plus'

About

Step that runs "swift test" in the local directory and export the results into Bitrise Test Plugin with code coverage

Topics

Resources

License

Stars

Watchers

Forks