diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47c5cc39..626101b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,8 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - uses: hashicorp/setup-terraform@v3 + - uses: actions/setup-python@v4 id: setup-python with: diff --git a/tests/test_runners/test_azure_runner.py b/tests/test_runners/test_azure_runner.py index a62478d2..5ef10a46 100644 --- a/tests/test_runners/test_azure_runner.py +++ b/tests/test_runners/test_azure_runner.py @@ -171,18 +171,23 @@ def test_remove_matcha_dir(matcha_testing_directory: str, template_runner: Azure assert not os.path.exists(matcha_dir) -def test_provision(matcha_testing_directory: str, template_runner: AzureRunner): +def test_provision( + matcha_testing_directory: str, + template_runner: AzureRunner, + mock_output: Callable[[str, bool], Union[str, Dict[str, str]]],): """Test service can provision resources using terraform. Args: matcha_testing_directory (str): Testing directory template_runner (AzureRunner): a AzureRunner object instance + mock_output (Callable[[str, bool], Union[str, Dict[str, str]]]): the mock output """ os.chdir(matcha_testing_directory) template_runner._check_terraform_installation = MagicMock() template_runner._validate_terraform_config = MagicMock() template_runner._initialize_terraform = MagicMock() template_runner._apply_terraform = MagicMock() + template_runner.tfs.terraform_client.output = MagicMock(wraps=mock_output) os.makedirs(os.path.join(matcha_testing_directory, ".matcha", "infrastructure"))