Skip to content

test(destination): make BDD subaccount creation idempotent#172

Open
jplbrun wants to merge 1 commit into
mainfrom
test/destination-bdd-idempotent-cleanup
Open

test(destination): make BDD subaccount creation idempotent#172
jplbrun wants to merge 1 commit into
mainfrom
test/destination-bdd-idempotent-cleanup

Conversation

@jplbrun

@jplbrun jplbrun commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Disclaimer: Do not include SAP-internal or customer-specific information in this PR (e.g. internal system URLs, customer names, tenant IDs, or confidential configurations). This is a public repository.

Description

The BDD integration tests for destination creation at subaccount level fail if a previous test run fails or is interrupted before cleanup, leaving the destination on the BTP subaccount. The next run then attempts to create it again and receives an error, causing the test to fail for reasons unrelated to the code under test.

This PR fixes that by replicating the idempotent cleanup pattern already used in other steps, attempting to delete the destination before creating it. The delete is wrapped in a try/except so it is silently skipped if the destination does not exist yet, making the step safe for both first runs and reruns.

Related Issue

N/A

Type of Change

Please check the relevant option:

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Dependency update

How to Test

  1. Create a destination with name 'test-dest-delete', type HTTP and url 'https://delete.example.com' on your BTP subaccount
  2. Run the integration tests for destination: uv run pytest tests/destination/integration/ -v
  3. Check that tests/destination/integration/test_destination_bdd.py::test_delete_destination fails with the current code. With this PR, the same test should pass and 'test-dest-delete' should be automatically deleted

Checklist

Before submitting your PR, please review and check the following:

  • I have read the Contributing Guidelines
  • I have verified that my changes solve the issue
  • I have added/updated automated tests to cover my changes
  • All tests pass locally
  • I have verified that my code follows the Code Guidelines
  • I have updated documentation (if applicable)
  • I have added type hints for all public APIs
  • My code does not contain sensitive information (credentials, tokens, etc.)
  • I have followed Conventional Commits for commit messages

Breaking Changes

None

Additional Notes

N/A

@jplbrun jplbrun marked this pull request as ready for review June 18, 2026 20:47
@jplbrun jplbrun requested a review from a team as a code owner June 18, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant