Skip to content

Commit

Permalink
chore: ignore paralleltest in subtests
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardobazico committed Oct 10, 2024
1 parent 97f28ab commit b490796
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 48 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ linters-settings:
- standard
- default
- prefix(ynabconverter)
paralleltest:
ignore-missing: false
ignore-missing-subtests: true

issues:
exclude-rules:
Expand Down
12 changes: 0 additions & 12 deletions internal/file/csv_importer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ func TestCsvImporter(t *testing.T) {
t.Parallel()

t.Run("should return error when file does not exist", func(t *testing.T) {
t.Parallel()

// Given
filePath := "examples/does-not-exist.csv"
csvReader := file.NewCsvImporterFromFileSytem(utils_test.ExampleFilesFS)
Expand All @@ -31,8 +29,6 @@ func TestCsvImporter(t *testing.T) {
})

t.Run("should return error when file exists but is not a csv", func(t *testing.T) {
t.Parallel()

// Given
filePath := "examples/not-a-csv.txt"
csvReader := file.NewCsvImporterFromFileSytem(utils_test.ExampleFilesFS)
Expand All @@ -44,8 +40,6 @@ func TestCsvImporter(t *testing.T) {
})

t.Run("should not return error when file exists", func(t *testing.T) {
t.Parallel()

// Given
filePath := "examples/cash_app_report.csv"
csvReader := file.NewCsvImporterFromFileSytem(utils_test.ExampleFilesFS)
Expand All @@ -56,8 +50,6 @@ func TestCsvImporter(t *testing.T) {
})

t.Run("should not return error when file exists and is empty", func(t *testing.T) {
t.Parallel()

// Given
filePath := "examples/empty.csv"
csvReader := file.NewCsvImporterFromFileSytem(utils_test.ExampleFilesFS)
Expand All @@ -69,8 +61,6 @@ func TestCsvImporter(t *testing.T) {
})

t.Run("should ignore title from records", func(t *testing.T) {
t.Parallel()

// Given
filePath := "examples/just_title.csv"
csvReader := file.NewCsvImporterFromFileSytem(utils_test.ExampleFilesFS)
Expand All @@ -82,8 +72,6 @@ func TestCsvImporter(t *testing.T) {
})

t.Run("should return matrix of strings when file exists and is not empty", func(t *testing.T) {
t.Parallel()

// Given
filePath := "examples/cash_app_report.csv"
csvReader := file.NewCsvImporterFromFileSytem(utils_test.ExampleFilesFS)
Expand Down
8 changes: 0 additions & 8 deletions internal/file/opener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ func TestOpener(t *testing.T) {
t.Parallel()

t.Run("should open file in a given file system", func(t *testing.T) {
t.Parallel()

// Given
filePath := "examples/cash_app_report.csv"
opener := file.NewFileSytemOpener(utils_test.ExampleFilesFS)
Expand All @@ -29,8 +27,6 @@ func TestOpener(t *testing.T) {
})

t.Run("should open file using os.OpenFile when no file system is given", func(t *testing.T) {
t.Parallel()

// Given
filePath := "opener_test.go"
opener := file.NewOsOpener()
Expand All @@ -43,8 +39,6 @@ func TestOpener(t *testing.T) {
})

t.Run("should open file given an absolute path", func(t *testing.T) {
t.Parallel()

// Given
testFolder, _ := os.Getwd()
filePath := testFolder + "/opener_test.go"
Expand All @@ -58,8 +52,6 @@ func TestOpener(t *testing.T) {
})

t.Run("should fail when file does not exist", func(t *testing.T) {
t.Parallel()

// Given
filePath := "does-not-exist.csv"
opener := file.NewOsOpener()
Expand Down
6 changes: 0 additions & 6 deletions pkg/reports/cashapp/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ func TestCashAppReportImporter(t *testing.T) {
t.Parallel()

t.Run("should return error when file does not exist", func(t *testing.T) {
t.Parallel()

// Given
cashAppReport := cashapp.NewCashAppReport(file.NewCsvImporterFromFileSytem(utils_test.ExampleFilesFS))
// When
Expand All @@ -27,8 +25,6 @@ func TestCashAppReportImporter(t *testing.T) {
})

t.Run("should parse file and get an array of cashapp.Transaction", func(t *testing.T) {
t.Parallel()

// Given
cashAppReport := cashapp.NewCashAppReport(file.NewCsvImporterFromFileSytem(utils_test.ExampleFilesFS))
// When
Expand Down Expand Up @@ -56,8 +52,6 @@ func TestCashAppReportImporter(t *testing.T) {
})

t.Run("should implement report.ReportImporter interface", func(t *testing.T) {
t.Parallel()

// Given
cashAppReport := cashapp.NewCashAppReport(file.NewCsvImporterFromFileSytem(utils_test.ExampleFilesFS))
// When
Expand Down
1 change: 0 additions & 1 deletion pkg/reports/cashapp/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"ynabconverter/pkg/reports/cashapp"
)

//nolint:paralleltest // t.Setenv isn't compatible with parallel tests
func TestCashAppTransaction(t *testing.T) {
t.Run("should create a cashapp.Transaction from a record", func(t *testing.T) {
// Given
Expand Down
2 changes: 0 additions & 2 deletions pkg/reports/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ func TestTransaction(t *testing.T) {
t.Parallel()

t.Run("should implement report.Transactioner interface", func(t *testing.T) {
t.Parallel()

// Given
transaction := reports.Transaction{
Counterparty: "MTA*NYCT PAYGO",
Expand Down
11 changes: 0 additions & 11 deletions pkg/reports/ynab/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ func TestYnabRecordTransformer(t *testing.T) {
t.Parallel()

t.Run("should implement report.ReportExporter interface", func(t *testing.T) {
t.Parallel()

// Given
ynabRecordTransformer := ynab.NewYnabRecordTransformer()
// When
Expand All @@ -27,8 +25,6 @@ func TestYnabRecordTransformer(t *testing.T) {
})

t.Run("should return the header", func(t *testing.T) {
t.Parallel()

// Given
ynabRecordTransformer := ynab.NewYnabRecordTransformer()
// When
Expand All @@ -38,8 +34,6 @@ func TestYnabRecordTransformer(t *testing.T) {
})

t.Run("should return a record", func(t *testing.T) {
t.Parallel()

// Given
ynabRecordTransformer := ynab.NewYnabRecordTransformer()
// When
Expand Down Expand Up @@ -83,10 +77,7 @@ func TestYnabRecordTransformer(t *testing.T) {

t.Run("GetRecordsWithHeader", func(t *testing.T) {
t.Parallel()

t.Run("should return records with header as first item", func(t *testing.T) {
t.Parallel()

// Given
ynabRecordTransformer := ynab.NewYnabRecordTransformer()
// When
Expand Down Expand Up @@ -123,8 +114,6 @@ func TestYnabRecordTransformer(t *testing.T) {
})

t.Run("should return an error if the transaction amount is invalid", func(t *testing.T) {
t.Parallel()

// Given
ynabRecordTransformer := ynab.NewYnabRecordTransformer()
// When
Expand Down
8 changes: 0 additions & 8 deletions pkg/reports/ynab/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ func TestYnabTransaction(t *testing.T) {
// ```

t.Run("should create a ynab.Transaction from a Transaction", func(t *testing.T) {
t.Parallel()

// Given
transaction := reports.Transaction{
Counterparty: "MTA*NYCT PAYGO",
Expand All @@ -50,8 +48,6 @@ func TestYnabTransaction(t *testing.T) {
})

t.Run("should create a YnabTransaction from a cashapp.Transaction", func(t *testing.T) {
t.Parallel()

// Given
cashAppTransaction := cashapp.Transaction{
TransactionID: "rmgsrz",
Expand Down Expand Up @@ -83,8 +79,6 @@ func TestYnabTransaction(t *testing.T) {
})

t.Run("should fail to create YnabTransaction if transaction.GetDatetime() fails", func(t *testing.T) {
t.Parallel()

// Given
cashAppNotValidDateTransaction := cashapp.Transaction{
Date: "not a valid date",
Expand All @@ -96,8 +90,6 @@ func TestYnabTransaction(t *testing.T) {
})

t.Run("should fail to create YnabTransaction if transaction.GetAmount() fails", func(t *testing.T) {
t.Parallel()

// Given
cashAppNotValidAmountTransaction := cashapp.Transaction{
Date: "2023-10-06 23:59:59 EDT",
Expand Down

0 comments on commit b490796

Please sign in to comment.