Yes, integration tests in Pulumi typically interact with real resources and services. These tests deploy actual infrastructure, perform operations like updates, and validate the desired state of the infrastructure. As a result, integration tests can provide a higher level of confidence that your Infrastructure as Code is working correctly.
However, it's important to note that integration tests can take longer to run and may have costs associated with creating and managing resources in cloud providers. To minimize the impact of these factors, you can follow some best practices:
Clean up resources: Ensure your tests clean up the resources they create to avoid unnecessary costs and clutter in your cloud provider.
Use separate environments: Run integration tests in a separate environment from your production environment to prevent unintended changes or disruptions to your production infrastructure.
Run tests in parallel: If possible, run integration tests in parallel to reduce overall test execution time.
Use environment variables or configuration files: Use environment variables or configuration files to manage credentials, resource names, and other settings that may vary between test runs or environments.
Always consider the trade-offs between the thoroughness of integration tests and the time and cost they may incur. In some cases, unit tests may provide sufficient coverage for your infrastructure, and you can reserve integration tests for more critical or complex components.