Remove bid files in test cleanup
All checks were successful
Integration Tests / test-integration (pull_request) Successful in 1m17s

This commit is contained in:
Prathamesh Musale 2024-03-02 10:59:01 +05:30
parent 0e2828d41e
commit 72fb7e5e46

View File

@ -2,6 +2,8 @@ package auction
import (
"fmt"
"os"
"path/filepath"
"cosmossdk.io/math"
"github.com/stretchr/testify/suite"
@ -60,6 +62,8 @@ func (ets *E2ETestSuite) SetupSuite() { //nolint: all
func (ets *E2ETestSuite) TearDownSuite() {
ets.T().Log("tearing down integration test suite")
ets.network.Cleanup()
ets.cleanupBidFiles()
}
func (ets *E2ETestSuite) createAccountWithBalance(accountName string, accountAddress *string) {
@ -125,3 +129,20 @@ func (ets *E2ETestSuite) createAuctionAndBid(createAuction, createBid bool) stri
return auctionId
}
func (ets *E2ETestSuite) cleanupBidFiles() error {
matches, err := filepath.Glob(fmt.Sprintf("%s-*.json", bidderAccount))
if err != nil {
fmt.Printf("Error matching bidder files: %v\n", err)
return err
}
for _, match := range matches {
err := os.Remove(match)
if err != nil {
return err
}
}
return nil
}