Skip to content

Commit 8cb0d8f

Browse files
authored
Merge pull request #143 from mikev-cw/main
fix tests v2
2 parents 97ef1cc + b229831 commit 8cb0d8f

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

.github/workflows/flutter-ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ jobs:
2424
cache-path: ${{ runner.tool_cache }}/flutter
2525

2626
- run: |
27-
flutter --version
2827
flutter pub get
29-
flutter test
28+
flutter test --concurrency=1
3029
flutter build apk
3130
flutter build appbundle

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ jobs:
88
- uses: subosito/flutter-action@v2
99
with:
1010
channel: 'stable'
11-
- run: flutter test
11+
- run: flutter test --concurrency=1

lib/database/sossoldi_database.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class SossoldiDatabase {
137137

138138
}
139139

140-
Future fillDemoData() async {
140+
Future fillDemoData({int countOfGeneratedTransaction = 10000}) async {
141141
// Add some fake accounts
142142
await _database?.execute('''
143143
INSERT INTO bankAccount(id, name, symbol, color, startingValue, active, mainAccount, createdAt, updatedAt) VALUES
@@ -179,7 +179,6 @@ class SossoldiDatabase {
179179
var accounts = [70,71,72];
180180
var outNotes = ['Grocery', 'Tolls', 'Toys', 'ETF Consultant Parcel', 'Concert', 'Clothing', 'Pizza', 'Drugs', 'Laundry', 'Taxes', 'Health insurance', 'Furniture', 'Car Fuel', 'Train', 'Amazon', 'Delivery', 'CHEK dividends', 'Babysitter', 'sono.pove.ro Fees', 'Quingentole trip'];
181181
var categories = [10,11,12,13,14];
182-
int countOfGeneratedTransaction = 10000;
183182
double maxAmountOfSingleTransaction = 250.00;
184183
int dateInPastMaxRange = (countOfGeneratedTransaction / 90 ).round() * 30; // we want simulate about 90 transactions per month
185184
num fakeSalary = 5000;

test/model/bank_account_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void main() {
106106
});
107107

108108
test("selectAll", () async {
109-
await sossoldiDatabase.fillDemoData();
109+
await sossoldiDatabase.fillDemoData(countOfGeneratedTransaction: 2000);
110110

111111
try{
112112
await db.transaction((txn) async {
@@ -172,7 +172,7 @@ void main() {
172172
});
173173

174174
test("accountDailyBalance", () async {
175-
await sossoldiDatabase.fillDemoData();
175+
await sossoldiDatabase.fillDemoData(countOfGeneratedTransaction: 2000);
176176

177177
try{
178178
await db.transaction((txn) async {

test/model/transaction_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void main() {
146146
});
147147

148148
test("lastMonthDailyTransactions", () async {
149-
await sossoldiDatabase.fillDemoData();
149+
await sossoldiDatabase.fillDemoData(countOfGeneratedTransaction: 2000);
150150

151151
try{
152152
await db.transaction((txn) async {
@@ -199,7 +199,7 @@ void main() {
199199
});
200200

201201
test("currentMonthDailyTransactions", () async {
202-
await sossoldiDatabase.fillDemoData();
202+
await sossoldiDatabase.fillDemoData(countOfGeneratedTransaction: 2000);
203203

204204
try{
205205
await db.transaction((txn) async {
@@ -252,7 +252,7 @@ void main() {
252252
});
253253

254254
test("currentMonthDailyTransactions single account", () async {
255-
await sossoldiDatabase.fillDemoData();
255+
await sossoldiDatabase.fillDemoData(countOfGeneratedTransaction: 2000);
256256

257257
try{
258258
await db.transaction((txn) async {
@@ -310,7 +310,7 @@ void main() {
310310
});
311311

312312
test("currentYearMontlyTransactions", () async {
313-
await sossoldiDatabase.fillDemoData();
313+
await sossoldiDatabase.fillDemoData(countOfGeneratedTransaction: 2000);
314314

315315
try{
316316
await db.transaction((txn) async {

0 commit comments

Comments
 (0)