Building with Bazel, Episode 15: Run Unit Tests | Kodeco

Learn how to define unit tests in your Build file and then how to run your tests using Bazel.


This is a companion discussion topic for the original entry at https://www.kodeco.com/31558158-building-with-bazel/lessons/15
1 Like

On building the tests, getting error:

ERROR: /Users/deepanshugautam/personal/build_tools/bazel/BazelBuild/Bullseye-iOS/BUILD:34:14: Compiling Swift module //Bullseye-iOS:tests failed: (Exit 1): worker failed: error executing command (from target //Bullseye-iOS:tests) bazel-out/darwin_arm64-opt-exec-2B5CBBC6-ST-521287fc850f/bin/external/build_bazel_rules_swift/tools/worker/worker swiftc ... (remaining 1 argument skipped)
error: emit-module command failed with exit code 1 (use -v to see invocation)
Bullseye-iOS/BullseyeTests/BullseyeTests.swift:8:8: error: no such module 'XCTest'
import XCTest
       ^
Bullseye-iOS/BullseyeTests/BullseyeTests.swift:8:8: error: no such module 'XCTest'
import XCTest
       ^
1 Like

Thank you @deepanshugautam09 for reaching out and sharing the error in your code. We appreciate your engagement with the community for the first time. Rest assured, we’ll address your question shortly and provide assistance. Stay tuned for the response! @vegetarianzombie