-
Notifications
You must be signed in to change notification settings - Fork 180
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
Add UI tests for TFC views #1468
Draft
dbanck
wants to merge
15
commits into
main
Choose a base branch
from
f-tfc-test-views
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
dbanck
commented
Jun 5, 2023
- Add vscode-extension-tester for UI tests
- Ignore temporary test files
- Mock projects response
- WIP: Add TFC UI test
* Terraform Cloud Host Setting Adds a setting for terraform.cloud.hostname and sets app.terraform.io as default value. Closes #1398 * Implement Terraform Cloud Authentication Provider This implements the `vscode.AuthenticationProvider` interface and creates a TFC specific provider. This handles listing existing sessions, creating and removing sessions. Storing sessions/tokens will be improved by #1397. Currently it only securely stores the token. Future improvement can be done to prevent looking up user data every time the session is reloaded. The TFC instance to target is defaulted to `app.terraform.io` with a configuration setting to override. This was added in #1398. Future work should discover whether detecting the TFC instance from the configuration available in the current working space is desirable. One of the primary ways a user will trigger authentication will be through the VS Code Command palette commands, so #1399 is added here to finish out the login workflow. This currently only supports one logged in user at a time. In the future, this may be extended to support multiple user tokens. Closes #1396 * Remove type-cast for promise * Update src/providers/authenticationProvider.ts Co-authored-by: Daniel Banck <dbanck@users.noreply.github.com> * Update package.json Co-authored-by: Daniel Banck <dbanck@users.noreply.github.com> * Update lockfile --------- Co-authored-by: Daniel Banck <daniel@dbanck.de> Co-authored-by: Daniel Banck <dbanck@users.noreply.github.com>
* Add allowSyntheticDefaultImports to TS options We have to enable this to get proper types from Zodios. This flag does not affect the JavaScript emitted by TypeScript, it only for the type checking. * eslint: Disable @typescript-eslint/naming-convention * Introduce terraformCloud API client * Add endpoint descriptions * Add projects endpoint * Add pagination to endpoints * Enable filtering of workspaces * Split endpoints into separate files * Keep earlyApiClient as earlyApiClient to avoid confusion * terraformCloud: add missing enums for run & workspace * Address/update remaining TODOs * Add a test mock server using msw --------- Co-authored-by: Daniel Banck <daniel@dbanck.de>
* Store all session data in SecretStorage --------- Co-authored-by: Daniel Banck <daniel@dbanck.de>
This adds a new view container for Terraform Cloud with two new views for Workspaces and Runs. A new icon is used for the view container. It uses the apiclient to pull workspace information and display it in the view. It introduces a new command terraform.cloud.organization.picker and adds it to the login command. This command presents the user with a quickpick to choose an organization to view workspaces. After the user chooses the org, it populates a statusbar item with the organization and sets it in workspacestate. The workspace view uses that organization when querying TFC for workspaces.
* Implement basic TreeView provider for TFC runs * Update src/providers/tfc/runProvider.ts Co-authored-by: James Pogran <jpogran@outlook.com> * package: Update command name * Note TODO comment about ingress attributes --------- Co-authored-by: James Pogran <jpogran@outlook.com>
This adds a new prompt when the login workflow is initiated that asks the user how they want to authenticate: from the terraform cli config file, generate a new token on the web, or enter it manually. The user can choose to have the extension read the terraform cli configuration file for the token. This means the user can reuse tokens they already configured to use with TFC without having to copy paste or create new tokens. This also adds a user prompt to open the TFC website to generate a user token. This reuses the terraform cli login page to prompt the user to generate a new token. If the user selects to enter an existing token, a new prompt is opened where the user can enter the token.
This commit refreshes the runs view when refreshing the workspace view by adding a call to the runDataProvider.refresh when performing workspaceProvider.refresh. If a user has selected a workspace, then refreshes the view, the selected workspace tree item is passed to the runDataProvider so that the runs for that workspace are refreshed. If no workspace is selected, then the runDataProvider is passed undefined, which will clear it's view. The user can then select a workspace to view runs.
* Contribute new filter icon and command * Add search query parameter to projects endpoint * Implement project quick pick * Improve error messages
This commit adds a command and button to the Workspace View to open the selected workspace in the system browser
radeksimko
force-pushed
the
f-tfc
branch
4 times, most recently
from
October 6, 2023 13:53
33dc6e4
to
be8d2c9
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.