-
Notifications
You must be signed in to change notification settings - Fork 323
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
Tests and improvements for secrets in cloud subdirectories #8791
Conversation
5abfa9f
to
850a054
Compare
b14189a
to
7eb5a72
Compare
@@ -1,3 +1,4 @@ | |||
private |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JaroslavTulach per your suggestion on using the private
keyword more, I thought that it may make sense to mark this module as private
, so I did!
It only required moving as_hideable_value
elsewhere (but I assume the new place actually fits it better anyway), because it needs to be usable in other libraries (e.g. AWS
).
850a054
to
d018d38
Compare
3929af5
to
ec3dffd
Compare
2c09f61
to
53d690d
Compare
b20faae
to
c3c0a37
Compare
… everything relevant is covered by Enso_User tests below
Test.group "Enso Cloud Basic Utils" pending=setup.pending <| | ||
Test.specify "will report Not_Logged_In if no credentials file is found" <| | ||
non_existent_file = (enso_project.data / "nonexistent-file") . absolute . normalize | ||
non_existent_file.exists.should_be_false | ||
|
||
Test_Environment.unsafe_with_environment_override "ENSO_CLOUD_CREDENTIALS_FILE" non_existent_file.path <| | ||
# This test has to run before any other Cloud access, otherwise the token may already be cached. | ||
Cloud_Utils.authorization_header.should_fail_with Cloud_Utils.Not_Logged_In | ||
|
||
Test.specify "should be able to get the cloud URL from environment" <| | ||
api_url = Cloud_Utils.cloud_root_uri | ||
api_url.should_equal setup.api_url.to_text | ||
|
||
Test.specify "should be able to read the authorization token" pending=setup.mock_only_pending <| | ||
Cloud_Utils.authorization_header.to_display_text.should_equal "Authorization: Bearer "+Cloud_Tests_Setup.test_token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed these tests, because they were checking private implementation details (and I think we are not yet skipping private
check for tests).
IMO it was OK to remove because everything relevant is covered by Enso_User tests below which should be run on CI because they only rely on the http-test-helper
mock, which is available on CI.
So IMO there was not much added value in these whitebox tests.
Pull Request Description
Enso_File.create_directory
andEnso_File.delete
, and basic tests for itEnso_Secret.list
is obtained - using a different Cloud endpoint allows us to implement the desired logic, the default endpoint was giving us all secrets which was not what we wanted here.Enso_Secret.update
and tests for itImportant Notes
Notes describing any problems with the current Cloud API:
https://docs.google.com/document/d/1x8RUt3KkwyhlxGux7XUGfOdtFSAZV3fI9lSSqQ3XsXk/edit
Apparently, everything that was needed to make this feature work has already been implemented, although a few features needed workarounds on Enso side to work properly.
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.