Skip to content

Commit

Permalink
Merge branch 'release/7.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Mar 27, 2020
2 parents a3cd4b2 + d2054de commit dab2377
Show file tree
Hide file tree
Showing 19 changed files with 628 additions and 358 deletions.
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ Generated\ Files/
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml

# Build Results of an ATL Project
[Dd]ebugPS/
Expand All @@ -71,7 +72,6 @@ StyleCopReport.xml
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
Expand Down Expand Up @@ -189,6 +189,8 @@ PublishScripts/

# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
Expand Down Expand Up @@ -264,7 +266,9 @@ ServiceFabricBackup/
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- Backup*.rdl
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl

# Microsoft Fakes
FakesAssemblies/
Expand Down
38 changes: 26 additions & 12 deletions GitReleaseManager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,38 @@ create:
footer-content: You can download this release from [nuget.org](https://www.nuget.org/packages/Picton.Messaging/{milestone})
footer-includes-milestone: true
milestone-replace-text: '{milestone}'
close:
use-issue-comments: true
issue-comment: |-
:tada: This issue has been resolved in version {milestone} :tada:
The release is available on:
- [GitHub Release](https://github.com/{owner}/{repository}/releases/tag/{milestone})
- [NuGet Package](https://www.nuget.org/packages/Picton.Messaging/{milestone})
Your **[GitReleaseManager](https://github.com/GitTools/GitReleaseManager)** bot :package::rocket:
export:
include-created-date-in-title: true
created-date-string-format: MMMM dd, yyyy
perform-regex-removal: true
regex-text: '### Where to get it(\r\n)*You can .*\)'
multiline-regex: true
issue-labels-include:
- Breaking Change
- Bug
- New Feature
- Improvement
- Documentation
- Breaking Change
- Bug
- New Feature
- Improvement
- Documentation
- Security
issue-labels-exclude:
- Question
- Duplicate
- Invalid
- Wontfix
- Question
- Duplicate
- Invalid
- Wontfix
- Build
- Internal Refactoring
issue-labels-alias:
- name: Documentation
header: Documentation
plural: Documentation
- name: Documentation
header: Documentation
plural: Documentation
3 changes: 3 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
mode: ContinuousDelivery
branches:
feature:
regex: feature(s)?[/-]
mode: ContinuousDeployment
develop:
regex: dev(elop)?(ment)?$
mode: ContinuousDeployment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>Picton.Messaging.IntegrationTests</AssemblyName>
<RootNamespace>Picton.Messaging.IntegrationTests</RootNamespace>
</PropertyGroup>
Expand All @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="App.Metrics.Reporting.Http" Version="3.1.0" />
<PackageReference Include="App.Metrics.Reporting.Http" Version="3.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down
44 changes: 19 additions & 25 deletions Source/Picton.Messaging.IntegrationTests/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using App.Metrics;
using App.Metrics.Scheduling;
using Microsoft.Azure.Storage;
using Microsoft.Azure.Storage.Queue;
using Picton.Managers;
using Picton.Messaging.IntegrationTests.Datadog;
using Picton.Messaging.Logging;
Expand Down Expand Up @@ -57,23 +55,23 @@ static void Main()
}

// Setup the message queue in Azure storage emulator
var storageAccount = CloudStorageAccount.DevelopmentStorageAccount;
var connectionString = "UseDevelopmentStorage=true";
var queueName = "myqueue";
var numberOfMessages = 25;

logger(Logging.LogLevel.Info, () => "Begin integration tests...");

var stringMessagesLogger = logProvider.GetLogger("StringMessages");
AddStringMessagesToQueue(numberOfMessages, queueName, storageAccount, stringMessagesLogger).Wait();
ProcessSimpleMessages(queueName, storageAccount, stringMessagesLogger, metrics);
AddStringMessagesToQueue(numberOfMessages, queueName, connectionString, stringMessagesLogger).Wait();
ProcessSimpleMessages(queueName, connectionString, stringMessagesLogger, metrics);

var simpleMessagesLogger = logProvider.GetLogger("SimpleMessages");
AddSimpleMessagesToQueue(numberOfMessages, queueName, storageAccount, simpleMessagesLogger).Wait();
ProcessSimpleMessages(queueName, storageAccount, simpleMessagesLogger, metrics);
AddSimpleMessagesToQueue(numberOfMessages, queueName, connectionString, simpleMessagesLogger).Wait();
ProcessSimpleMessages(queueName, connectionString, simpleMessagesLogger, metrics);

var messagesWithHandlerLogger = logProvider.GetLogger("MessagesWithHandler");
AddMessagesWithHandlerToQueue(numberOfMessages, queueName, storageAccount, messagesWithHandlerLogger).Wait();
ProcessMessagesWithHandlers(queueName, storageAccount, messagesWithHandlerLogger, metrics);
AddMessagesWithHandlerToQueue(numberOfMessages, queueName, connectionString, messagesWithHandlerLogger).Wait();
ProcessMessagesWithHandlers(queueName, connectionString, messagesWithHandlerLogger, metrics);

// Flush the console key buffer
while (Console.KeyAvailable) Console.ReadKey(true);
Expand All @@ -83,39 +81,36 @@ static void Main()
Console.ReadKey();
}

public static async Task AddStringMessagesToQueue(int numberOfMessages, string queueName, CloudStorageAccount storageAccount, Logger logger)
public static async Task AddStringMessagesToQueue(int numberOfMessages, string queueName, string connectionString, Logger logger)
{
logger(Logging.LogLevel.Info, () => $"Adding {numberOfMessages} string messages to the queue...");

var cloudQueueClient = storageAccount.CreateCloudQueueClient();
var cloudQueue = cloudQueueClient.GetQueueReference(queueName);
await cloudQueue.CreateIfNotExistsAsync().ConfigureAwait(false);
await cloudQueue.ClearAsync().ConfigureAwait(false);
var queueManager = new QueueManager(connectionString, queueName);
await queueManager.ClearAsync().ConfigureAwait(false);
for (var i = 0; i < numberOfMessages; i++)
{
await cloudQueue.AddMessageAsync(new CloudQueueMessage($"Hello world {i}")).ConfigureAwait(false);
await queueManager.AddMessageAsync($"Hello world {i}").ConfigureAwait(false);
}
}

public static async Task AddSimpleMessagesToQueue(int numberOfMessages, string queueName, CloudStorageAccount storageAccount, Logger logger)
public static async Task AddSimpleMessagesToQueue(int numberOfMessages, string queueName, string connectionString, Logger logger)
{
logger(Logging.LogLevel.Info, () => $"Adding {numberOfMessages} simple messages to the queue...");

var queueManager = new QueueManager(queueName, storageAccount);
await queueManager.CreateIfNotExistsAsync().ConfigureAwait(false);
var queueManager = new QueueManager(connectionString, queueName);
await queueManager.ClearAsync().ConfigureAwait(false);
for (var i = 0; i < numberOfMessages; i++)
{
await queueManager.AddMessageAsync($"Hello world {i}").ConfigureAwait(false);
}
}

public static void ProcessSimpleMessages(string queueName, CloudStorageAccount storageAccount, Logger logger, IMetrics metrics)
public static void ProcessSimpleMessages(string queueName, string connectionString, Logger logger, IMetrics metrics)
{
Stopwatch sw = null;

// Configure the message pump
var messagePump = new AsyncMessagePump(queueName, storageAccount, 10, null, TimeSpan.FromMinutes(1), 3, metrics)
var messagePump = new AsyncMessagePump(connectionString, queueName, 10, null, TimeSpan.FromMinutes(1), 3, metrics)
{
OnMessage = (message, cancellationToken) =>
{
Expand Down Expand Up @@ -144,25 +139,24 @@ public static void ProcessSimpleMessages(string queueName, CloudStorageAccount s
logger(Logging.LogLevel.Info, () => $"\tDone in {sw.Elapsed.ToDurationString()}");
}

public static async Task AddMessagesWithHandlerToQueue(int numberOfMessages, string queueName, CloudStorageAccount storageAccount, Logger logger)
public static async Task AddMessagesWithHandlerToQueue(int numberOfMessages, string queueName, string connectionString, Logger logger)
{
logger(Logging.LogLevel.Info, () => $"Adding {numberOfMessages} messages with handlers to the queue...");

var queueManager = new QueueManager(queueName, storageAccount);
await queueManager.CreateIfNotExistsAsync().ConfigureAwait(false);
var queueManager = new QueueManager(connectionString, queueName);
await queueManager.ClearAsync().ConfigureAwait(false);
for (var i = 0; i < numberOfMessages; i++)
{
await queueManager.AddMessageAsync(new MyMessage { MessageContent = $"Hello world {i}" }).ConfigureAwait(false);
}
}

public static void ProcessMessagesWithHandlers(string queueName, CloudStorageAccount storageAccount, Logger logger, IMetrics metrics)
public static void ProcessMessagesWithHandlers(string queueName, string connectionString, Logger logger, IMetrics metrics)
{
Stopwatch sw = null;

// Configure the message pump
var messagePump = new AsyncMessagePumpWithHandlers(queueName, storageAccount, 10, null, TimeSpan.FromMinutes(1), 3, metrics);
var messagePump = new AsyncMessagePumpWithHandlers(connectionString, queueName, 10, null, TimeSpan.FromMinutes(1), 3, metrics);
messagePump.OnQueueEmpty = cancellationToken =>
{
// Stop the timer
Expand Down
Loading

0 comments on commit dab2377

Please sign in to comment.