Skip to content

Commit

Permalink
Use separate db for jobservice integration tests (#521) (#3373)
Browse files Browse the repository at this point in the history
Create and use a separate database for the Job-Service integration tests
(known as the `teste2eAirflow` Mage target). The localdev Armada setup
uses the default/built-in database 'postgres', and since there are
table-name collisions between the Armada and the Job Service databases
(e.g. both have a 'jobs' table), create and use a db named 'jobservice'
for the Job Service integration tests.

Signed-off-by: Rich Scott <[email protected]>
  • Loading branch information
richscott authored Feb 6, 2024
1 parent cc8c2e7 commit a24fd16
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion developer/dependencies/postgres-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-E
CREATE USER docker;
CREATE DATABASE postgresv2;
GRANT ALL PRIVILEGES ON DATABASE postgresv2 TO docker;
EOSQL
CREATE DATABASE jobservice;
GRANT ALL PRIVILEGES ON DATABASE jobservice TO docker;
EOSQL
2 changes: 1 addition & 1 deletion e2e/setup/jobservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ postgresConfig:
port: 5432
user: postgres
password: psw
dbname: postgres
dbname: jobservice
sslmode: disable
grpcPool:
initialConnections: 5
Expand Down
2 changes: 1 addition & 1 deletion internal/jobservice/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (s *JobServiceServer) GetJobStatus(ctx context.Context, opts *js.JobService
FromMessageId: fromMessageId,
}
}
log.Infof("Subscribing %s-%s with messageId %s", opts.Queue, opts.JobSetId, fromMessageId)
log.Infof("Subscribing to queue %s jobset %s messageId %s", opts.Queue, opts.JobSetId, fromMessageId)
} else {
if err := s.jobRepository.UpdateJobSetDb(ctx, opts.Queue, opts.JobSetId, fromMessageId); err != nil {
log.WithFields(requestFields).Warn(err)
Expand Down

0 comments on commit a24fd16

Please sign in to comment.