postgres-switch-for-tests #255

Merged
lash merged 15 commits from postgres-switch-for-tests into master 2025-01-10 12:07:07 +01:00
Member
  • Add a flag to switch to postgres while running the test

also resolves #119

- Add a flag to switch to postgres while running the test also resolves https://git.grassecon.net/urdt/ussd/issues/119
Alfred-mk added 3 commits 2025-01-06 13:10:26 +01:00
Alfred-mk added 5 commits 2025-01-08 08:59:30 +01:00
Alfred-mk added 1 commit 2025-01-08 09:06:25 +01:00
Alfred-mk requested review from lash 2025-01-08 09:12:44 +01:00
Alfred-mk changed title from WIP: postgres-switch-for-tests to postgres-switch-for-tests 2025-01-08 09:13:26 +01:00
lash requested changes 2025-01-08 12:37:27 +01:00
lash left a comment
Owner

I am wondering, since this affects the connection string, whether we should merge in the other PR into this one first.

I am wondering, since this affects the connection string, whether we should merge in the other PR into this one first.
cmd/main.go Outdated
@ -27,3 +29,3 @@
func init() {
initializers.LoadEnvVariables()
initializers.LoadEnvVariables(baseDir)
Owner

I don't think we want to use the testdataloader package in main. Let's remove the basedir, and if needed using a different env/config file should be a matter of switches.

I don't think we want to use the `testdataloader` package in main. Let's remove the basedir, and if needed using a different env/config file should be a matter of switches.
Alfred-mk marked this conversation as resolved
@ -88,6 +89,11 @@ func (ms *MenuStorageService) getOrCreateDb(ctx context.Context, existingDb db.D
return nil, fmt.Errorf("failed to select the database")
}
schema, ok := ctx.Value("Schema").(string)
Owner

can we try to use the connection string instead of context, if it works? https://github.com/jackc/pgx/issues/1013

it fits better with the connection string refactor that I will merge this into afterwards.

can we try to use the connection string instead of context, if it works? https://github.com/jackc/pgx/issues/1013 it fits better with the connection string refactor that I will merge this into afterwards.
Alfred-mk marked this conversation as resolved
@ -101,0 +105,4 @@
connStr := BuildConnStr()
// Ensure the schema exists
err = ensureSchemaExists(ctx, connStr, schema)
Owner

If we are using connection string, then this needs to be url parsed to get the query string in order to determine the schema.

If we are using connection string, then this needs to be url parsed to get the query string in order to determine the schema.
lash marked this conversation as resolved
lash added 29 commits 2025-01-08 23:27:37 +01:00
lash changed target branch from master to lash/purify-more 2025-01-08 23:28:37 +01:00
lash added 1 commit 2025-01-09 08:42:32 +01:00
Alfred-mk added 1 commit 2025-01-09 11:01:42 +01:00
lash changed target branch from lash/purify-more to master 2025-01-09 13:04:58 +01:00
Alfred-mk added 1 commit 2025-01-10 11:41:31 +01:00
Alfred-mk added 1 commit 2025-01-10 11:43:34 +01:00
Alfred-mk requested review from lash 2025-01-10 11:47:53 +01:00
lash merged commit 8f5ed0cd4f into master 2025-01-10 12:07:07 +01:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: urdt/ussd#255
No description provided.