Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala client: enhance mock Armada server for unit tests #4214

Merged

Conversation

richscott
Copy link
Member

@richscott richscott commented Feb 17, 2025

These changes add better checking of pre-requisite resources (existence of specified queue when submitting a job, etc) in the Armada Server mock for the Scala client. Simple maps are used to track creation/deletion of queues and jobs.

Several Armada client convenience functions now more accurately return GRPC runtime exceptions (instead of just an empty List or object) in the same way that the Scala binding would with a real Armada cluster. JobIDs are now generated using ULIDs.

A client/scala/scala-armada-client/.sbtopts has been created, with a Java define directive to squelch the sbt warnings about converting relative (e.g. ../../../) paths to absolute, so a bare sbt build or sbt test should be quieter.

Use a map to track queues created/queried/delete by
Scala clients, for sanity-checking during unit-testing.

Fixes G-Research/spark#40

Signed-off-by: Rich Scott <richscott@sent.com>
Use a map to track job creation/queries/deletion. Also,
set "allow globbing" option for sbt compiler via .sbtopts
file.

Signed-off-by: Rich Scott <richscott@sent.com>
Signed-off-by: Rich Scott <richscott@sent.com>
@richscott richscott self-assigned this Feb 17, 2025
@richscott richscott marked this pull request as ready for review February 17, 2025 22:32
@richscott richscott requested a review from EnricoMi February 18, 2025 16:04
GeorgeJahad
GeorgeJahad previously approved these changes Feb 18, 2025
Copy link
Collaborator

@GeorgeJahad GeorgeJahad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a few questions, but it looks good to me.

Copy link
Collaborator

@GeorgeJahad GeorgeJahad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@richscott richscott merged commit 2a935d5 into armadaproject:master Feb 18, 2025
15 checks passed
@richscott richscott deleted the rich/scala-mock-server-enhance branch February 18, 2025 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants