1. A data engineering team is setting up a CI pipeline using GitHub Actions for a Databricks project managed with Databricks Asset Bundles. They want to run unit tests (using pytest) on every pull request BEFORE deploying to any Databricks workspace. Which GitHub Actions step configuration BEST achieves this?
- A. A step that runs `databricks bundle validate` followed by `databricks bundle deploy --target dev` and then triggers the test job via `databricks bundle run`.
- B. A step that installs Python dependencies from `requirements-test.txt` and runs `pytest tests/unit/` directly in the GitHub Actions runner, without connecting to any Databricks workspace.✓ Correct
- C. A step that uses the `databricks/run-notebook` GitHub Action to execute a test notebook on an existing always-on development cluster.
- D. A step that packages the project as a wheel using `python setup.py bdist_wheel` and uploads it to a test PyPI index for validation.
Explanation
Unit tests should be fast, isolated, and not require external infrastructure. Running pytest directly in the GitHub Actions runner (which has Python available) executes the unit tests in a pure Python/PySpark local mode environment without any Databricks workspace dependency. This is the correct separation: unit tests run in CI without workspace connectivity; integration/deployment tests may involve a workspace. Option A deploys to a dev workspace before tests pass, which inverts the correct CI order. Option C uses an always-on cluster (cost waste, no isolation) and runs tests as a notebook, which is an integration test pattern, not unit testing. Option D (building a wheel and uploading to PyPI) is a packaging step, not a test execution step.