Skip to content

Add local Abfs credential renewal integration test - #1193

Merged
tdas merged 7 commits into
unitycatalog:mainfrom
openinx:1175-abfs-local-it-test
Nov 14, 2025
Merged

tdas merged 7 commits into
unitycatalog:mainfrom
openinx:1175-abfs-local-it-test

Conversation

@openinx

@openinx openinx commented Nov 11, 2025

Copy link
Copy Markdown
Collaborator

PR Checklist

  • A description of the changes is added to the description of this PR.
  • If there is a related issue, make sure it is linked to this PR.
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added or modified a feature, documentation in docs is updated

Description of changes

The related issue is : #1175, this PR achieved the similar local integration tests that we've did in aws s3. #1123

@openinx

openinx commented Nov 12, 2025

Copy link
Copy Markdown
Collaborator Author

The failure CI caused by the flaky test:

[error] Failed: Total 21, Failed 1, Errors 0, Passed 20
[info] Passed: Total 80, Failed 0, Errors 0, Passed 80
[error] Failed tests:
[error] 	io.unitycatalog.cli.table.CliTableCRUDTest
[info] 
[info] ------- Jacoco Coverage Report -------

}

@Override
protected String scheme() {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This will be overrided in the cloud vendor CredRenewFileSystem, such as S3CredFileSystem, and AbfsCredFileSystem.

private CredentialsGenerator createCredentialsGenerator(S3StorageConfig config) {
// Dynamically load and initialize the generator if it's intentionally configured.
if (config.getCredentialGenerator() != null) {
if (config.getCredentialsGenerator() != null) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

actually.. if we have to be grammatically correct ... it should "credentialGenerator"
its like, we say "fruit market", not "fruits market"

so better to fix the property :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the comment, have the same question before. I choose this because the aws credentials provider use the AwsCredentialsProvider name. Please see https://github.com/unitycatalog/unitycatalog/blob/main/connectors/spark/src/main/scala/io/unitycatalog/spark/auth/AwsVendedTokenProvider.java#L7

That's why I change to credentialsGenerator. For the aws name, seems like it's a provider which will generate many new credentials. that's why they add a s.

I don't have strong opinion about this, if you prefer the credentialGenerator. I can change it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The point for me is: we may need a consistent naming.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

100% agree on consistent naming.
since there is precedence on AwsCredentialsProvider, lets go with credentialsGenerator 👍


@Override
public AzureCredential generate(CredentialContext ctx) {
String sasToken =

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

}
}

class DatalakeCredentialsGenerator implements AzureCredentialsGenerator {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

private String clientId;
private String clientSecret;
private String credentialsGenerator;
private boolean testMode;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Maybe we can replace the testMode with setting credentialsGenerator to be the StaticAzureCredentialsGenerator from here, but that should be trivial, and can be a seperate PR to address.

@openinx openinx closed this Nov 12, 2025
@openinx openinx reopened this Nov 12, 2025
@openinx
openinx force-pushed the 1175-abfs-local-it-test branch from ef54ee1 to e1ee6ae Compare November 12, 2025 17:36
Comment on lines +19 to +26
serverProperties.put("s3.bucketPath.0", "s3://" + BUCKET_NAME);
serverProperties.put("s3.accessKey.0", "accessKey0");
serverProperties.put("s3.secretKey.0", "secretKey0");
serverProperties.put("s3.sessionToken.0", "sessionToken0");
// Customize the test credential generator to issue a new credential every 30-second interval.
// This allows us to verify whether credential renewal is functioning correctly by checking
// if the current credential matches the expected time window.
serverProperties.put("s3.credentialsGenerator.0", AwsCredGenerator.class.getName());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we be using the server properties constants?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it's better to define the server properties constants, and use them everywhere. So that it will always deliver the correct configuration for all places.

I think it can be a separate issue to address all the constant properties.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Filed a new issue here: #1207

@tdas tdas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! just a few comments.

@openinx
openinx force-pushed the 1175-abfs-local-it-test branch from e1ee6ae to 108ec3b Compare November 13, 2025 22:20
Signed-off-by: Zheng Hu <[email protected]>
@openinx

openinx commented Nov 13, 2025

Copy link
Copy Markdown
Collaborator Author

Retry the CI.

@openinx openinx closed this Nov 13, 2025
@openinx openinx reopened this Nov 13, 2025
@tdas
tdas merged commit 4f5240b into unitycatalog:main Nov 14, 2025
tdas pushed a commit that referenced this pull request Nov 18, 2025
**PR Checklist**

- [x] A description of the changes is added to the description of this
PR.
- [x] If there is a related issue, make sure it is linked to this PR.
- [x] If you've fixed a bug or added code that should be tested, add
tests!
- [ ] If you've added or modified a feature, documentation in `docs` is
updated

**Description of changes**

Backport the [PR
change](#1193) of
[issue](#1175) to
branch-0.3
The backport progress is here:
#1163


After merged this
#1150, there is no
conflict any more. So it's a clean patch.

Signed-off-by: Zheng Hu <[email protected]>
tdas pushed a commit that referenced this pull request Nov 21, 2025
**PR Checklist**

- [ ] A description of the changes is added to the description of this
PR.
- [ ] If there is a related issue, make sure it is linked to this PR.
- [ ] If you've fixed a bug or added code that should be tested, add
tests!
- [ ] If you've added or modified a feature, documentation in `docs` is
updated

**Description of changes**
This branch is currently based on @openinx's PR
#1193 which creates an
abstraction for integration tests.

**TODO:** update this branch once his PR is merged to main. The delta
for this PR can be found here:
https://github.com/openinx/unitycatalog/pull/1/files
<!-- Please state what you've changed and how it might affect the users.
-->

---------

Signed-off-by: Zheng Hu <[email protected]>
Signed-off-by: TimothyW553 <[email protected]>
Co-authored-by: Zheng Hu <[email protected]>
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