Skip to content

Commit

Permalink
order /db table by test time to get the 100 most recent in each table
Browse files Browse the repository at this point in the history
  • Loading branch information
JudahNour committed Aug 11, 2023
1 parent 9415a12 commit 670fa5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/db/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ func (m *Postgres) GetEnvironmentTestsAndTestCases() (map[string]interface{}, er
var environmentTests []models.DBEnvironmentTest
var testCases []models.DBTestCase

err := m.db.Select(&environmentTests, "SELECT * FROM db_environment_tests LIMIT 100")
err := m.db.Select(&environmentTests, "SELECT * FROM db_environment_tests ORDER BY TestTime DESC LIMIT 100")
if err != nil {
return nil, fmt.Errorf("failed to execute SQL query for environment tests: %v", err)
}

err = m.db.Select(&testCases, "SELECT * FROM db_test_cases LIMIT 100")
err = m.db.Select(&testCases, "SELECT * FROM db_test_cases ORDER BY TestTime DESC LIMIT 100")
if err != nil {
return nil, fmt.Errorf("failed to execute SQL query for test cases: %v", err)

Expand Down

0 comments on commit 670fa5a

Please sign in to comment.