Skip to content

feat: add initial eventhubs test components#265

Open
stijnmoreels wants to merge 26 commits intoarcus-azure:mainfrom
stijnmoreels:feature/add-eventhubs-test-components
Open

feat: add initial eventhubs test components#265
stijnmoreels wants to merge 26 commits intoarcus-azure:mainfrom
stijnmoreels:feature/add-eventhubs-test-components

Conversation

@stijnmoreels
Copy link
Member

Adds initial testing components for interaction with Azure Event Hubs.

Relates to #90

@netlify
Copy link

netlify bot commented Jan 31, 2025

Deploy Preview for arcus-testing canceled.

Name Link
🔨 Latest commit eb47de7
🔍 Latest deploy log https://app.netlify.com/projects/arcus-testing/deploys/69a015939fd1e300088dad66

@arcus-automation
Copy link
Collaborator

arcus-automation commented Jan 31, 2025

🧪 Code coverage summary

Metric Value
Line coverage 🟢 93.2%
Branch coverage 🟢 83.6%

Great job! 😎 Your code coverage is higher than my caffeine levels! ☕

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 3, 2025

@stijnmoreels stijnmoreels added feature All issues related to new features area:messaging All issues related to testing messaging systems. labels Apr 18, 2025
@stijnmoreels stijnmoreels added this to the v2.1 milestone Apr 28, 2025
@stijnmoreels stijnmoreels modified the milestones: v2.1, v2.2 Jun 13, 2025
@stijnmoreels stijnmoreels modified the milestones: v2.2, v2.3 Nov 13, 2025
@stijnmoreels stijnmoreels marked this pull request as ready for review January 2, 2026 06:16
@stijnmoreels stijnmoreels requested a review from a team as a code owner January 2, 2026 06:16
fgheysels pushed a commit that referenced this pull request Jan 9, 2026
Use a read-only variant for the `ToList` result of the Azure Service Bus
filtering.

Follow-up of #265 where @fgheysels made my brain 🧠 work.
Copy link
Member

@fgheysels fgheysels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just have some suggestions

stijnmoreels and others added 2 commits January 22, 2026 09:02
Co-authored-by: Frederik Gheysels <frederik.gheysels@telenet.be>
Co-authored-by: Frederik Gheysels <frederik.gheysels@telenet.be>
ArgumentNullException.ThrowIfNull(eventHubsNamespaceResourceId);
ArgumentException.ThrowIfNullOrWhiteSpace(consumerGroup);

var credential = new DefaultAzureCredential();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some doubts on this approach.
I don't like the fact that we're instantiating a DefaultAzureCredential ourselves here. Wouldn't it be better if we pass in the ITokenCredential that must b e used as a parameter ?
(Using DefaultAzureCredential gives some overhead as well, as multiple auth mechanisms will be tried)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Remember that this is also used a lot locally, where you expect to go over the local VS, VS Code, Browser settings. Then using that default credential is a perfect fit for local development/testing.
  • For every test fixture that we provide, there is always an overload to pass in the client yourself or by using a different authentication protocol/approach.

/// Sets up an existing Azure Event Hub.
/// </summary>
/// <returns>The name of the newly set up Azure Event Hub.</returns>
public async Task<string> WhenHubAvailableAsync()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the name of the method is a bit confusing ?
When looking at the code, this looks like a method that 'blocks' until the eventhub is available.
Maybe the name can be changed to WaitUntilHubAvailableAsync ?

/just my opinion :P

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, and now I see the method below (WhenHubNotAvailable). So these are 2 factory-like methods that are called depending whether you're testing against Azure or not ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the name of the method is a bit confusing ?
When looking at the code, this looks like a method that 'blocks' until the eventhub is available.
Maybe the name can be changed to WaitUntilHubAvailableAsync ?

If we would include 'wait until ...' in the name, we would be exposing internal infrastructure implementation details to the test body. The test scenario is only concerned about having a hub available or not, not 'how' or 'when' that hub becomes available.

Ah, and now I see the method below (WhenHubNotAvailable). So these are 2 factory-like methods that are called depending whether you're testing against Azure or not ?

It is to give a clear indication in the test bodies that we're testing against a remotely-available Azure Event Hub or not, yes. Without exposing to the test body 'how' or 'when' that is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:messaging All issues related to testing messaging systems. feature All issues related to new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants