Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
4d00d0e
Try the docker stuff at CI
StuartFergusonVme Dec 12, 2022
a5c2598
Phase 2 (all the services)
StuartFergusonVme Dec 12, 2022
cedbb1e
Another attempt
StuartFergusonVme Dec 12, 2022
42ad48f
:|
StuartFergusonVme Dec 12, 2022
0408081
add better logging
StuartFergusonVme Dec 12, 2022
7e2bbd2
.
StuartFergusonVme Dec 13, 2022
797b847
:|
StuartFergusonVme Dec 13, 2022
3ae0002
:|
StuartFergusonVme Dec 13, 2022
6c24b1c
:|
StuartFergusonVme Dec 13, 2022
e40b6c8
:|
StuartFergusonVme Dec 13, 2022
1172ec4
:|
StuartFergusonVme Dec 13, 2022
e9f4e26
:|
StuartFergusonVme Dec 13, 2022
f8cf9fa
:|
StuartFergusonVme Dec 13, 2022
1be4843
..
StuartFergusonVme Dec 13, 2022
f013ddc
:|
StuartFergusonVme Dec 13, 2022
d32e153
:|
StuartFergusonVme Dec 13, 2022
4d43f7d
...
StuartFergusonVme Dec 13, 2022
8ce7dea
:|
StuartFergusonVme Dec 13, 2022
6566812
sudo
StuartFergusonVme Dec 13, 2022
1d61728
after nuget update
StuartFergusonVme Dec 15, 2022
1d124d4
.
StuartFergusonVme Dec 15, 2022
eb0560a
...
StuartFergusonVme Dec 16, 2022
ca868e0
...
StuartFergusonVme Dec 16, 2022
5bae2d8
WIP
StuartFergusonVme Dec 16, 2022
d55667e
Merge branch 'main' into task/#112_trydockertestonmacos
StuartFergusonVme Dec 17, 2022
afea46c
see how this goes :|
StuartFergusonVme Dec 18, 2022
4b86147
debug ipaddresses
StuartFergusonVme Dec 21, 2022
16da6f0
..
StuartFergusonVme Dec 21, 2022
17242f1
test
StuartFergusonVme Dec 21, 2022
2990bef
.
StuartFergusonVme Dec 21, 2022
d715873
...
StuartFergusonVme Dec 21, 2022
6d4b20c
..
StuartFergusonVme Dec 21, 2022
f059e25
not sure what gonna happen here
StuartFergusonVme Dec 21, 2022
96574e1
:|
StuartFergusonVme Dec 21, 2022
8c0aef3
:|
StuartFergusonVme Dec 21, 2022
9755067
:|
StuartFergusonVme Dec 21, 2022
3e8d2ad
...
StuartFergusonVme Dec 21, 2022
71a3b11
...
StuartFergusonVme Dec 22, 2022
2363039
...
StuartFergusonVme Dec 22, 2022
8cd1872
...
StuartFergusonVme Dec 22, 2022
ab84f0e
:|
StuartFergusonVme Dec 22, 2022
08f89a4
...
StuartFergusonVme Dec 22, 2022
019f954
logging upgrade
StuartFergusonVme Dec 22, 2022
289163f
more logging tweaks
StuartFergusonVme Dec 22, 2022
bccb0ea
...
StuartFergusonVme Dec 22, 2022
8510a75
another logging refactor
StuartFergusonVme Dec 22, 2022
0126d59
.
StuartFergusonVme Dec 22, 2022
088e256
remove docker swtup for now
StuartFergusonVme Dec 22, 2022
6a07fd7
..
StuartFergusonVme Dec 22, 2022
ac787af
..
StuartFergusonVme Dec 22, 2022
4ffb52c
:|
StuartFergusonVme Dec 23, 2022
7b39044
..
StuartFergusonVme Dec 23, 2022
2225469
:|
StuartFergusonVme Dec 23, 2022
823a51b
.
StuartFergusonVme Dec 24, 2022
42fdb63
WIP
StuartFergusonVme Dec 24, 2022
c7bec91
...
StuartFergusonVme Dec 27, 2022
4972395
:|
StuartFergusonVme Dec 27, 2022
2503fb9
..
StuartFergusonVme Dec 27, 2022
dbcfd7b
...
StuartFergusonVme Dec 27, 2022
55a538d
:|
StuartFergusonVme Dec 27, 2022
4a25992
.
StuartFergusonVme Dec 28, 2022
db768f0
:|
StuartFergusonVme Dec 28, 2022
4f2e99c
:|
StuartFergusonVme Dec 28, 2022
70a4592
...
StuartFergusonVme Dec 28, 2022
ee14b58
...
StuartFergusonVme Dec 28, 2022
a4bcf93
...
StuartFergusonVme Dec 28, 2022
6df6a84
...
StuartFergusonVme Dec 28, 2022
13f28a5
some response handling refactoring
StuartFergusonVme Dec 28, 2022
ddf4f71
try fix UI test
StuartFergusonVme Dec 29, 2022
535c042
:|
StuartFergusonVme Dec 29, 2022
3d3d438
try adding ios tests
StuartFergusonVme Dec 29, 2022
7dc351e
:|
StuartFergusonVme Dec 29, 2022
8f24c95
..
StuartFergusonVme Dec 30, 2022
e8a6844
..
StuartFergusonVme Dec 30, 2022
1577341
..
StuartFergusonVme Dec 30, 2022
06b4e58
enable all PR's
StuartFergusonVme Dec 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/createrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
debug: false
gitReleaseNotes: true

released-mac:
release-mac:
runs-on: macos-11
name: MacCatalyst Release
steps:
Expand Down
69 changes: 56 additions & 13 deletions .github/workflows/pullrequest_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,49 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Get IP
run: ipconfig getifaddr en0

- name: Cache Public IP
run: echo "ENV_IPADDRESS=$(ipconfig getifaddr en0)" >> $GITHUB_ENV

- name: Test IP
run: echo $ENV_IPADDRESS

- name: Setup Docker
run: |
brew install docker
colima start --cpu 2 --memory 8 --disk 100

- name: Pull images
run: |
docker pull stuartferguson/messagingservice:master
docker pull stuartferguson/estatemanagement:master
docker pull stuartferguson/securityservice:master
docker pull stuartferguson/transactionprocessor:master
docker pull stuartferguson/transactionprocessoracl:master
docker pull stuartferguson/testhosts:master
#docker pull stuartferguson/vouchermanagementacl:master
#docker pull stuartferguson/fileprocessor:master
docker pull stuartferguson/callbackhandler:master
docker pull stuartferguson/mobileconfiguration:master
docker pull mcr.microsoft.com/azure-sql-edge
docker pull eventstore/eventstore:21.10.0-buster-slim

- uses: malinskiy/action-android/install-sdk@release/0.1.1
- run: sdkmanager "platform-tools" "platforms;android-33"
- run: sdkmanager "build-tools;30.0.2"
- run: adb devices

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: '12.12.0'
#- name: Set up Node.js
# uses: actions/setup-node@v1
# with:
# node-version: '16.14.2'

- name: Set up Appium
run: |
npm install -g appium --unsafe-perm=true --allow-root
npm install -g appium@next --unsafe-perm=true --allow-root
appium driver install uiautomator2

- name: Setup .NET 7
uses: actions/setup-dotnet@v2
Expand All @@ -58,17 +88,30 @@ jobs:
- name: Run Unit Tests
run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj

#- name: Run Integration Tests - Android
# uses: malinskiy/action-android/emulator-run-cmd@release/0.1.1
# with:
# cmd: dotnet test TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj --filter (Category=PRTest)&(Category=Android)
# api: 28
# tag: default
# abi: x86
# verbose: true
- name: Run Integration Tests - Android
uses: malinskiy/action-android/emulator-run-cmd@release/0.1.4
with:
cmd: dotnet test TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj --filter (Category=PRTest)&(Category=Android)
api: 28
tag: default
abi: x86
verbose: false

#- name: Upload Android Artifact
# uses: actions/upload-artifact@v2.3.1
# with:
# name: android-ci-build
# path: src/MauiBeach/bin/Release/net6.0-android/*Signed.a*

- uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: tracelogsios
path: /Users/runner/txnproc/trace/

- name: Save logcat output
uses: actions/upload-artifact@master
if: failure()
with:
name: logcat
path: artifacts/logcat.log
44 changes: 34 additions & 10 deletions .github/workflows/pullrequest_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,48 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Get IP
run: ipconfig getifaddr en0

- name: Cache Public IP
run: echo "ENV_IPADDRESS=$(ipconfig getifaddr en0)" >> $GITHUB_ENV

- name: Test IP
run: echo $ENV_IPADDRESS

- name: Setup Docker
run: |
brew install docker
colima start --cpu 2 --memory 8 --disk 100

- name: Pull images
run: |
docker pull stuartferguson/messagingservice:master
docker pull stuartferguson/estatemanagement:master
docker pull stuartferguson/securityservice:master
docker pull stuartferguson/transactionprocessor:master
docker pull stuartferguson/transactionprocessoracl:master
docker pull stuartferguson/testhosts:master
docker pull stuartferguson/vouchermanagementacl:master
docker pull stuartferguson/fileprocessor:master
docker pull stuartferguson/callbackhandler:master
docker pull stuartferguson/mobileconfiguration:master
docker pull mcr.microsoft.com/azure-sql-edge
docker pull eventstore/eventstore:21.10.0-buster-slim

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.3'

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: '12.12.0'
node-version: '16.14.2'

- name: Set up Appium
run: |
npm install -g appium --unsafe-perm=true --allow-root
npm install -g appium@next --unsafe-perm=true --allow-root
appium driver install xcuitest

- name: Setup .NET 7
uses: actions/setup-dotnet@v2
Expand All @@ -51,11 +81,5 @@ jobs:
- name: Run Unit Tests
run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj

#- name: Run Integration Tests - iOS
# run: dotnet test TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj --filter "Category=PRTest&Category=iOS"

#- name: Upload iOS Artifact
# uses: actions/upload-artifact@v2.3.1
# with:
# name: ios-ci-build
# path: src/TransactionMobile.Maui/bin/Release/net6.0-ios/**/*.app/
- name: Run Integration Tests - iOS
run: dotnet test TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj --filter "Category=PRTest&Category=iOS"
10 changes: 5 additions & 5 deletions .github/workflows/pullrequest_maccatalyst.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ jobs:
- name: Run Unit Tests
run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj

# #- name: Upload MacCatalyst Artifact
# # uses: actions/upload-artifact@v2.3.1
# # with:
# # name: macos-ci-build
# # path: src/MauiBeach/bin/Release/net6.0-maccatalyst/**/*.app/
## #- name: Upload MacCatalyst Artifact
## # uses: actions/upload-artifact@v2.3.1
## # with:
## # name: macos-ci-build
## # path: src/MauiBeach/bin/Release/net6.0-maccatalyst/**/*.app/

7 changes: 0 additions & 7 deletions .github/workflows/pullrequest_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,3 @@ jobs:

- name: Run Unit Tests
run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj

- name: Upload Windows Artifact
uses: actions/upload-artifact@v2.3.1
with:
name: windows-ci-build
path: |
TransactionMobile.Maui/bin/Release/net6.0-windows*/**/TransactionMobile.Maui*.msix
38 changes: 0 additions & 38 deletions TestProject1/TestProject1.csproj

This file was deleted.

11 changes: 0 additions & 11 deletions TestProject1/UnitTest1.cs

This file was deleted.

1 change: 0 additions & 1 deletion TestProject1/Usings.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
using TransactionProcessorACL.DataTransferObjects.Responses;
using UIServices;
using Xunit;
using static SQLite.SQLite3;

public class TransactionRequestHandlerTests
{
Expand Down Expand Up @@ -63,7 +62,8 @@ public async Task TransactionRequestHandler_LogonTransactionRequest_Handle_IsHan
[Fact]
public async Task TransactionRequestHandler_PerformMobileTopupRequest_Handle_IsHandled()
{
this.TransactionService.Setup(t => t.PerformMobileTopup(It.IsAny<PerformMobileTopupRequestModel>(), It.IsAny<CancellationToken>())).ReturnsAsync(new SuccessResult<SaleTransactionResponseMessage>(new SaleTransactionResponseMessage {
this.TransactionService.Setup(t => t.PerformMobileTopup(It.IsAny<PerformMobileTopupRequestModel>(), It.IsAny<CancellationToken>())).ReturnsAsync(new SuccessResult<PerformMobileTopupResponseModel>(new PerformMobileTopupResponseModel
{
ResponseCode = "0000"
}));

Expand All @@ -75,17 +75,17 @@ public async Task TransactionRequestHandler_PerformMobileTopupRequest_Handle_IsH
TestData.Operator1Product_100KES.Value,
TestData.CustomerEmailAddress);

Result<SaleTransactionResponseMessage> result = await this.TransactionRequestHandler.Handle(request, CancellationToken.None);
Result<PerformMobileTopupResponseModel> result = await this.TransactionRequestHandler.Handle(request, CancellationToken.None);

result.Success.ShouldBeTrue();
result.Data.IsSuccessfulTransaction().ShouldBeTrue();
result.Data.IsSuccessful.ShouldBeTrue();
}

[Fact]
public async Task TransactionRequestHandler_PerformVoucherIssueRequest_Handle_IsHandled()
{
this.TransactionService.Setup(t => t.PerformVoucherIssue(It.IsAny<PerformVoucherIssueRequestModel>(), It.IsAny<CancellationToken>())).ReturnsAsync(new SuccessResult<SaleTransactionResponseMessage>(new SaleTransactionResponseMessage
{
this.TransactionService.Setup(t => t.PerformVoucherIssue(It.IsAny<PerformVoucherIssueRequestModel>(), It.IsAny<CancellationToken>())).ReturnsAsync(new SuccessResult<PerformVoucherIssueResponseModel>(new PerformVoucherIssueResponseModel
{
ResponseCode = "0000"
}));

Expand All @@ -98,10 +98,10 @@ public async Task TransactionRequestHandler_PerformVoucherIssueRequest_Handle_Is
TestData.Operator3Product_200KES.Value,
TestData.CustomerEmailAddress);

Result<SaleTransactionResponseMessage> result = await this.TransactionRequestHandler.Handle(request, CancellationToken.None);
Result<PerformVoucherIssueResponseModel> result = await this.TransactionRequestHandler.Handle(request, CancellationToken.None);

result.Success.ShouldBeTrue();
result.Data.IsSuccessfulTransaction().ShouldBeTrue();
result.Data.IsSuccessful.ShouldBeTrue();
}

[Fact]
Expand Down Expand Up @@ -146,7 +146,7 @@ public async Task TransactionRequestHandler_PerformBillPaymentGetAccountRequest_
[Fact]
public async Task TransactionRequestHandler_PerformBillPaymentMakePaymentRequest_Handle_IsHandled()
{
this.TransactionService.Setup(t => t.PerformBillPaymentMakePayment(It.IsAny<PerformBillPaymentMakePaymentModel>(), It.IsAny<CancellationToken>())).ReturnsAsync(new SuccessResult<SaleTransactionResponseMessage>(new SaleTransactionResponseMessage
this.TransactionService.Setup(t => t.PerformBillPaymentMakePayment(It.IsAny<PerformBillPaymentMakePaymentModel>(), It.IsAny<CancellationToken>())).ReturnsAsync(new SuccessResult<PerformBillPaymentMakePaymentResponseModel>(new PerformBillPaymentMakePaymentResponseModel
{
ResponseCode = "0000"
}));
Expand All @@ -160,17 +160,17 @@ public async Task TransactionRequestHandler_PerformBillPaymentMakePaymentRequest
TestData.CustomerMobileNumber,
TestData.PaymentAmount);

Result<SaleTransactionResponseMessage> result = await this.TransactionRequestHandler.Handle(request, CancellationToken.None);
Result<PerformBillPaymentMakePaymentResponseModel> result = await this.TransactionRequestHandler.Handle(request, CancellationToken.None);

result.Success.ShouldBeTrue();
result.Data.IsSuccessfulTransaction().ShouldBeTrue();
result.Data.IsSuccessful.ShouldBeTrue();
}

[Fact]
public async Task TransactionRequestHandler_PerformBillPaymentMakePaymentRequest_PaymentFailed_Handle_IsHandled()
{
this.TransactionService.Setup(t => t.PerformBillPaymentMakePayment(It.IsAny<PerformBillPaymentMakePaymentModel>(), It.IsAny<CancellationToken>())).ReturnsAsync(new SuccessResult<SaleTransactionResponseMessage>(new SaleTransactionResponseMessage
{
this.TransactionService.Setup(t => t.PerformBillPaymentMakePayment(It.IsAny<PerformBillPaymentMakePaymentModel>(), It.IsAny<CancellationToken>())).ReturnsAsync(new SuccessResult<PerformBillPaymentMakePaymentResponseModel>(new PerformBillPaymentMakePaymentResponseModel
{
ResponseCode = "0001"
}));

Expand All @@ -183,15 +183,16 @@ public async Task TransactionRequestHandler_PerformBillPaymentMakePaymentRequest
TestData.CustomerMobileNumber,
TestData.PaymentAmount);

Result<SaleTransactionResponseMessage> result = await this.TransactionRequestHandler.Handle(request, CancellationToken.None);
Result<PerformBillPaymentMakePaymentResponseModel> result = await this.TransactionRequestHandler.Handle(request, CancellationToken.None);

result.Failure.ShouldBeTrue();
}

[Fact]
public async Task TransactionRequestHandler_PerformReconciliationRequest_NoTransactions_Handle_IsHandled()
{
this.TransactionService.Setup(t => t.PerformReconciliation(It.IsAny<PerformReconciliationRequestModel>(), It.IsAny<CancellationToken>())).ReturnsAsync(new SuccessResult<ReconciliationResponseMessage>(new ReconciliationResponseMessage {
this.TransactionService.Setup(t => t.PerformReconciliation(It.IsAny<PerformReconciliationRequestModel>(), It.IsAny<CancellationToken>())).ReturnsAsync(new SuccessResult<PerformReconciliationResponseModel>(new PerformReconciliationResponseModel
{
ResponseCode = "0000"
}));
this.DatabaseContext.Setup(d => d.GetTransactions(It.IsAny<Boolean>())).ReturnsAsync(new List<TransactionRecord>());
Expand All @@ -200,26 +201,26 @@ public async Task TransactionRequestHandler_PerformReconciliationRequest_NoTrans
TestData.DeviceIdentifier,
TestData.ApplicationVersion);

Result<ReconciliationResponseMessage> result = await this.TransactionRequestHandler.Handle(request, CancellationToken.None);
Result<PerformReconciliationResponseModel> result = await this.TransactionRequestHandler.Handle(request, CancellationToken.None);

result.Success.ShouldBeTrue();
result.Data.IsSuccessfulReconciliation().ShouldBeTrue();
result.Data.IsSuccessful.ShouldBeTrue();
}

[Fact]
public async Task TransactionRequestHandler_PerformReconciliationRequest_TransactionsStored_Handle_IsHandled() {
this.TransactionService.Setup(t => t.PerformReconciliation(It.IsAny<PerformReconciliationRequestModel>(), It.IsAny<CancellationToken>())).ReturnsAsync(new SuccessResult<ReconciliationResponseMessage>(new ReconciliationResponseMessage
{
this.TransactionService.Setup(t => t.PerformReconciliation(It.IsAny<PerformReconciliationRequestModel>(), It.IsAny<CancellationToken>())).ReturnsAsync(new SuccessResult<PerformReconciliationResponseModel>(new PerformReconciliationResponseModel
{
ResponseCode = "0000"
}));

this.DatabaseContext.Setup(d => d.GetTransactions(It.IsAny<Boolean>())).ReturnsAsync(TestData.StoredTransactions);

PerformReconciliationRequest request = PerformReconciliationRequest.Create(TestData.TransactionDateTime, TestData.DeviceIdentifier, TestData.ApplicationVersion);

Result<ReconciliationResponseMessage> result = await this.TransactionRequestHandler.Handle(request, CancellationToken.None);
Result<PerformReconciliationResponseModel> result = await this.TransactionRequestHandler.Handle(request, CancellationToken.None);

result.Success.ShouldBeTrue();
result.Data.IsSuccessfulReconciliation().ShouldBeTrue();
result.Data.IsSuccessful.ShouldBeTrue();
}
}
Loading