This commit is contained in:
2018-12-07 21:10:19 +00:00
parent daa744d7c9
commit 56c7b8a1be
5 changed files with 153 additions and 9 deletions

View File

@@ -5,16 +5,157 @@ Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOiIxNTQyNjY5Njc3IiwiZXhwIjoi
## IMMEDIATE ITEMS ## IMMEDIATE ITEMS
See below todo to figure out what is wrong with the filter query next month (for starters)
It's nothing obvious that's for sure.
==================
DEVOPS - PUT UP A DEVOPS COPY AFTER THE ABOVE IS DONE AND RUN ALL UNIT TESTS TO CONFIRM DATE FILTER COD DEVOPS - PUT UP A DEVOPS COPY AFTER THE ABOVE IS DONE AND RUN ALL UNIT TESTS TO CONFIRM DATE FILTER COD
FIRST RUN WITH HUGE DATASET LOG:
Starting extension
Finding projects for pattern c:/data\code\raven\test\raven-integration/
Found 1 matches for pattern in folder c:\data\code\raven\test\raven-integration
Evaluating match c:/data/code/raven/test/raven-integration/
Adding directory c:/data/code/raven/test/raven-integration/
Executing dotnet test -t -v=q in c:/data/code/raven/test/raven-integration/
Discoverd tests with xunit. Found 135 in 1 directories
Executing dotnet build in c:/data/code/raven/test/raven-integration/
Executing dotnet test --no-build --logger "trx;LogFileName=C:\Users\John\AppData\Local\Temp\test-explorer\0.trx" in c:/data/code/raven/test/raven-integration/
Process 12920 started
Test run for c:\data\code\raven\test\raven-integration\bin\Debug\netcoreapp2.1\raven-integration.dll(.NETCoreApp,Version=v2.1)
Microsoft (R) Test Execution Command Line Tool Version 15.7.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
Failed raven_integration.DataFilterFilteringLists.TextOpNotEqualFilterWorks
Error Message:
Expected InclusiveMatchCount to be 2, but found 0.
Stack Trace:
at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 215
at FluentAssertions.Numeric.NumericAssertions`1.Be(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 49
at raven_integration.DataFilterFilteringLists.TextOpNotEqualFilterWorks() in c:\data\code\raven\test\raven-integration\DataFilter\DataFilterFilteringLists.cs:line 5162
Failed raven_integration.DataFilterFilteringLists.DecimalNotEqualToFilterWorks
Error Message:
Expected InclusiveMatchCount to be greater or equal to 1, but found 0.
Stack Trace:
at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 215
at FluentAssertions.Numeric.NumericAssertions`1.BeGreaterOrEqualTo(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 239
at raven_integration.DataFilterFilteringLists.DecimalNotEqualToFilterWorks() in c:\data\code\raven\test\raven-integration\DataFilter\DataFilterFilteringLists.cs:line 7142
Failed raven_integration.DataFilterFilteringLists.DateOpNotEqualToFilterWorks
Error Message:
Expected InclusiveMatchCount to be greater or equal to 1, but found 0.
Stack Trace:
at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 215
at FluentAssertions.Numeric.NumericAssertions`1.BeGreaterOrEqualTo(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 239
at raven_integration.DataFilterFilteringLists.DateOpNotEqualToFilterWorks() in c:\data\code\raven\test\raven-integration\DataFilter\DataFilterFilteringLists.cs:line 694
Failed raven_integration.DataFilterFilteringLists.TextOpLessThanOrEqualToFilterWorks
Error Message:
Expected InclusiveMatchCount to be 2, but found 0.
Stack Trace:
at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 215
at FluentAssertions.Numeric.NumericAssertions`1.Be(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 49
at raven_integration.DataFilterFilteringLists.TextOpLessThanOrEqualToFilterWorks() in c:\data\code\raven\test\raven-integration\DataFilter\DataFilterFilteringLists.cs:line 5041
Failed raven_integration.DataFilterFilteringLists.IntegerOpLessThanFilterWorks
Error Message:
Expected InclusiveMatchCount to be greater or equal to 1, but found 0.
Stack Trace:
at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 215
at FluentAssertions.Numeric.NumericAssertions`1.BeGreaterOrEqualTo(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 239
at raven_integration.DataFilterFilteringLists.IntegerOpLessThanFilterWorks() in c:\data\code\raven\test\raven-integration\DataFilter\DataFilterFilteringLists.cs:line 6068
Failed raven_integration.DataFilterFilteringLists.IntegerNotEqualToFilterWorks
Error Message:
Expected InclusiveMatchCount to be greater or equal to 1, but found 0.
Stack Trace:
at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 215
at FluentAssertions.Numeric.NumericAssertions`1.BeGreaterOrEqualTo(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 239
at raven_integration.DataFilterFilteringLists.IntegerNotEqualToFilterWorks() in c:\data\code\raven\test\raven-integration\DataFilter\DataFilterFilteringLists.cs:line 6271
Failed raven_integration.DataFilterFilteringLists.DecimalOpLessThanFilterWorks
Error Message:
Expected InclusiveMatchCount to be greater or equal to 1, but found 0.
Stack Trace:
at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 215
at FluentAssertions.Numeric.NumericAssertions`1.BeGreaterOrEqualTo(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 239
at raven_integration.DataFilterFilteringLists.DecimalOpLessThanFilterWorks() in c:\data\code\raven\test\raven-integration\DataFilter\DataFilterFilteringLists.cs:line 6939
Failed raven_integration.DataFilterFilteringLists.DateTokenInTheLast3MonthsFilterWorks
Error Message:
Expected ((JArray)a.ObjectResponse["data"]).Count to be greater than 0, but found 0.
Stack Trace:
at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 215
at FluentAssertions.Numeric.NumericAssertions`1.BeGreaterThan(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 217
at raven_integration.DataFilterFilteringLists.DateTokenInTheLast3MonthsFilterWorks() in c:\data\code\raven\test\raven-integration\DataFilter\DataFilterFilteringLists.cs:line 2209
Failed raven_integration.DataFilterFilteringLists.DateTokenInTheLast6MonthsFilterWorks
Error Message:
Expected ((JArray)a.ObjectResponse["data"]).Count to be greater than 0, but found 0.
Stack Trace:
at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 215
at FluentAssertions.Numeric.NumericAssertions`1.BeGreaterThan(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 217
at raven_integration.DataFilterFilteringLists.DateTokenInTheLast6MonthsFilterWorks() in c:\data\code\raven\test\raven-integration\DataFilter\DataFilterFilteringLists.cs:line 2310
Failed raven_integration.DataFilterFilteringLists.DateTokenNextMonthFilterWorks
Error Message:
Expected ExclusiveMatchCount to be 0, but found 1.
Stack Trace:
at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 215
at FluentAssertions.Numeric.NumericAssertions`1.Be(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 49
at raven_integration.DataFilterFilteringLists.DateTokenNextMonthFilterWorks() in c:\data\code\raven\test\raven-integration\DataFilter\DataFilterFilteringLists.cs:line 1606
Failed raven_integration.DataFilterFilteringLists.DateTokenPast90DaysFilterWorks
Error Message:
Expected ((JArray)a.ObjectResponse["data"]).Count to be greater than 0, but found 0.
Stack Trace:
at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\XUnit2TestFramework.cs:line 32
at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Execution\AssertionScope.cs:line 215
at FluentAssertions.Numeric.NumericAssertions`1.BeGreaterThan(T expected, String because, Object[] becauseArgs) in C:\projects\fluentassertions-vf06b\Src\FluentAssertions\Numeric\NumericAssertions.cs:line 217
at raven_integration.DataFilterFilteringLists.DateTokenPast90DaysFilterWorks() in c:\data\code\raven\test\raven-integration\DataFilter\DataFilterFilteringLists.cs:line 3818
Results File: C:\Users\John\AppData\Local\Temp\test-explorer\0.trx
Total tests: 135. Passed: 124. Failed: 11. Skipped: 0.
Test execution time: 53.2319 Seconds
Process 12920 finished
=-=-=
WITH SMALL DATASET MANY MORE PASSED EXCEPT THESE:
DateTokenPast90DaysFilterWorks
DateTokenNextMonthFilterWorks
DateTokenInTheLast6MonthsFilterWorks
DateTokenInTheLast3MonthsFilterWorks
Which failed repeatedly, I wonder if the tests are flawed or there's a weird date issue of some kind?
=-=-=-
Further data: Next Month filter - This is failing at devops only with the exclusive date being the first day of the month -1 seconds as written
However if I back it by 8 hours and 1 second then it passes, which is utc difference (7 hours fails still)
So what appears to be happening is the server at UTC is not correctly building the sql filter dates, Need to log that shit to see what is actually happening
TODO:
Put a debug log on the FilterSqlCriteriaBuilder to log the input and the output in debug mode so can see what is actually happening
Put it up to the server and check to see what is actually happening
I suspect that the issue is the criteria building code dates are starting out in UTC on devops then are further converted to UTC when building the final sql fragment
and somehow getting fucked in that process even though they should just be staying in the same UTC the whole time.
Here at this server locally they are starting out in pacific time and then converting to UTC properly, maybe?
- Nope, did a test and it's all good at the server, something else going on
Will need the debug log of the query built to see what the what next
=================
TESTING TODO - Are all tests viable with a huge dataset, try locally and rejig the tests as necessary to make them work properly with huge data if necessary
TESTING TODO - All date ranges should be on exact boundaries to ensure that all boundary date code in criteria builder is correct
SQL Criteria builder - Should it really be backing off a second for boundary edges? That will mean items that are less than a second but more than zero seconds will
be included whenb they shouldn't. If the sql server has 1 millesecond accuracy then it should be backed off one millisecond surely?
INITIAL TESTING NOTES: INITIAL TESTING NOTES:

View File

@@ -53,7 +53,10 @@ namespace AyaNova.Api.Controllers
<pre>{AySchema.currentSchema.ToString()}</pre> <pre>{AySchema.currentSchema.ToString()}</pre>
<h4>Server time</h4> <h4>Server time</h4>
<pre>{DateUtil.ServerDateTimeString(System.DateTime.UtcNow)}</pre> <pre>{DateUtil.ServerDateTimeString(System.DateTime.UtcNow)}</pre>
<pre>{TimeZoneInfo.Local.Id}</pre> <pre>{TimeZoneInfo.Local.Id}</pre>
<pre>Test datetime.now to string {System.DateTime.Now.ToString()}</pre>
<pre>Test datetime.UtcNow to string {System.DateTime.UtcNow.ToString()}</pre>
<pre>Test datetime.Now then converted to universaltime then to string {System.DateTime.Now.ToUniversalTime().ToString()}</pre>
<h4>Server logs</h4> <h4>Server logs</h4>
<pre>{ServerBootConfig.AYANOVA_LOG_PATH}</pre> <pre>{ServerBootConfig.AYANOVA_LOG_PATH}</pre>
</div> </div>

View File

@@ -380,7 +380,7 @@ namespace AyaNova
// ******************** TESTING WIPE DB ***************************** // ******************** TESTING WIPE DB *****************************
// //
//Set this to true to wipe the db and reinstall a trial license and re-seed the data //Set this to true to wipe the db and reinstall a trial license and re-seed the data
var TESTING_REFRESH_DB = true;//############################################################################################# var TESTING_REFRESH_DB = false;//#############################################################################################
#if (DEBUG) #if (DEBUG)
//TESTING //TESTING

View File

@@ -841,7 +841,7 @@ namespace AyaNova.Biz
} }
private static DateTime MaxMilliseconds(DateTime d) private static DateTime MaxMilliseconds(DateTime d)
{ {
if (d.Millisecond == 0) return d; if (d.Millisecond == 999) return d;
return new DateTime(d.Year, d.Month, d.Day, d.Hour, d.Minute, d.Second, 999, DateTimeKind.Utc); return new DateTime(d.Year, d.Month, d.Day, d.Hour, d.Minute, d.Second, 999, DateTimeKind.Utc);
} }

View File

@@ -12,8 +12,8 @@ namespace raven_integration
{ {
private static HttpClient client { get; } = new HttpClient(); private static HttpClient client { get; } = new HttpClient();
private static string API_BASE_URL = "http://localhost:7575/api/v8.0/"; private static string API_BASE_URL = "http://localhost:7575/api/v8.0/";
// private static string API_BASE_URL = "https://test.helloayanova.com/api/v8.0/"; // private static string API_BASE_URL = "https://test.helloayanova.com/api/v8.0/";
public static string TEST_DATA_FOLDER = @"..\..\..\testdata\"; public static string TEST_DATA_FOLDER = @"..\..\..\testdata\";