-
Notifications
You must be signed in to change notification settings - Fork 1k
chore(modelarmor): added floorsettings tests #2144
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
chore(modelarmor): added floorsettings tests #2144
Conversation
NOTE: Please set following environment variables required for running tests: Additionally, please grant the service account the following permissions in the above mentioned folder and org:
|
modelarmor/test/modelarmorTest.php
Outdated
/** | ||
* Reset project floor settings to default values | ||
*/ | ||
protected static function resetProjectFloorSettings(): void |
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.
The code across all the methods of type reset...FloorSettings
seems redundant. Can you please extract the common code in a separate method & use it for Project/Folder/Organization.
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.
Updated logic for resetting floor settings to remove redundant logic.
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.
NOTE: Please set following environment variables required for running tests: MA_FOLDER_ID:
695279264361
MA_ORG_ID:951890214235
Which project are these credentials for? I used these for the standard test project (php-docs-samples-kokoro
) and was unable to get them to work.
modelarmor/test/modelarmorTest.php
Outdated
self::$organizationId = getenv('MA_ORG_ID'); | ||
self::$folderId = getenv('MA_FOLDER_ID'); |
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.
let's use requireEnv
for these, that way people running the tests will know they're required:
self::$organizationId = getenv('MA_ORG_ID'); | |
self::$folderId = getenv('MA_FOLDER_ID'); | |
self::$organizationId = self::requireEnv('MA_ORG_ID'); | |
self::$folderId = self::requireEnv('MA_FOLDER_ID'); |
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.
updated, thanks.
Did not get this. |
@bshaffer Could you provide the service account used for running these tests? CC: @bhardwaj-prerna |
@iennae Can someone from your team help with this? |
@harshnasitcrest @iennae These tests should be able to run with ANY valid credentials as long as you set the appropriate environment variables. However, if you message me directly via workchat, I can either provide you with the credentials or run them myself. Edit: I ran these tests myself and I'm getting the following error:
|
test(modelarmorTest): reset floor settings before tests
@bshaffer Sharing the screenshot for successful run of tests on my local machine on the latest commit: I've requested to provision access to the folder and org with @bhardwaj-prerna . Once approved, you'll also be able run the tests. |
Added floor settings tests as issue b/424365799 is fixed.
Added tests for