-
Notifications
You must be signed in to change notification settings - Fork 207
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
feat: support test tool binary version #13093
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
60bc3ef
feat: install action support binary test tool
tecton d39c98a
fix: use npm as default option
tecton c577892
fix: add ut
tecton 75ea7a7
feat(template): make test tool default option in python template
tecton 4f7fb35
fix: schema change
tecton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,21 +4,29 @@ | |
/** | ||
* @author Xiaofu Huang <[email protected]> | ||
*/ | ||
import { hooks } from "@feathersjs/hooks/lib"; | ||
import { FxError, Result } from "@microsoft/teamsfx-api"; | ||
import * as path from "path"; | ||
import semver from "semver"; | ||
import { Service } from "typedi"; | ||
import { FxError, Result } from "@microsoft/teamsfx-api"; | ||
import { ErrorContextMW } from "../../../common/globalVars"; | ||
import { getLocalizedString } from "../../../common/localizeUtils"; | ||
import { InvalidActionInputError } from "../../../error/common"; | ||
import { | ||
DependencyStatus, | ||
EmptyLogger, | ||
EmptyTelemetry, | ||
TestToolReleaseType, | ||
v3DefaultHelpLink, | ||
} from "../../deps-checker"; | ||
import { DotnetChecker } from "../../deps-checker/internal/dotnetChecker"; | ||
import { FuncToolChecker } from "../../deps-checker/internal/funcToolChecker"; | ||
import { TestToolChecker } from "../../deps-checker/internal/testToolChecker"; | ||
import { LocalCertificate, LocalCertificateManager } from "../../local/localCertificateManager"; | ||
import { wrapRun } from "../../utils/common"; | ||
import { DriverContext } from "../interface/commonArgs"; | ||
import { ExecutionResult, StepDriver } from "../interface/stepDriver"; | ||
import { addStartAndEndTelemetry } from "../middleware/addStartAndEndTelemetry"; | ||
import { WrapDriverContext } from "../util/wrapUtil"; | ||
import { | ||
Summaries, | ||
|
@@ -29,16 +37,8 @@ import { | |
} from "./constant"; | ||
import { DotnetInstallationUserError } from "./error/dotnetInstallationUserError"; | ||
import { FuncInstallationUserError } from "./error/funcInstallationUserError"; | ||
import { InstallToolArgs } from "./interfaces/InstallToolArgs"; | ||
import { InvalidActionInputError } from "../../../error/common"; | ||
import { addStartAndEndTelemetry } from "../middleware/addStartAndEndTelemetry"; | ||
import { hooks } from "@feathersjs/hooks/lib"; | ||
import { getLocalizedString } from "../../../common/localizeUtils"; | ||
import { FuncToolChecker } from "../../deps-checker/internal/funcToolChecker"; | ||
import { DotnetChecker } from "../../deps-checker/internal/dotnetChecker"; | ||
import { ErrorContextMW } from "../../../common/globalVars"; | ||
import { TestToolChecker } from "../../deps-checker/internal/testToolChecker"; | ||
import { TestToolInstallationUserError } from "./error/testToolInstallationUserError"; | ||
import { InstallToolArgs } from "./interfaces/InstallToolArgs"; | ||
|
||
const ACTION_NAME = "devTool/install"; | ||
const helpLink = "https://aka.ms/teamsfx-actions/devtool-install"; | ||
|
@@ -127,8 +127,9 @@ export class ToolsInstallDriverImpl { | |
|
||
if (args.testTool) { | ||
await this.resolveTestTool( | ||
// Hardcode to npm release type if running from YAML | ||
TestToolReleaseType.Npm, | ||
args.testTool.releaseType == TestToolReleaseType.Binary | ||
? TestToolReleaseType.Binary | ||
: TestToolReleaseType.Npm, | ||
`${args.testTool.version}`, | ||
args.testTool.symlinkDir | ||
); | ||
|
@@ -329,6 +330,13 @@ export class ToolsInstallDriverImpl { | |
if (typeof args.testTool.symlinkDir !== "string") { | ||
throw new InvalidActionInputError(ACTION_NAME, ["testTool.symlinkDir"], helpLink); | ||
} | ||
if ( | ||
args.testTool.releaseType && | ||
args.testTool.releaseType !== TestToolReleaseType.Binary && | ||
args.testTool.releaseType !== TestToolReleaseType.Npm | ||
) { | ||
throw new InvalidActionInputError(ACTION_NAME, ["testTool.releaseType"], helpLink); | ||
} | ||
} | ||
} | ||
|
||
|
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
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
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
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
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
Oops, something went wrong.
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.
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.
whether local debug or test tool is the 1st choice depends on the flag {{#enableTestToolByDefault}}, which depends on if the TTK is a pre-release or a stable release.
I think it's ok to merge this first. Let's make the change in another PR.
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'll check with you offline. Thanks.