-
Notifications
You must be signed in to change notification settings - Fork 95
XRAY-140503 - Fix pnpm config resolver as it does not populate repo details in pnpm.yaml file #1564
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -159,6 +159,21 @@ func TestNpmConfigFile(t *testing.T) { | |
| assert.Equal(t, "repo-local", config.GetString("deployer.repo")) | ||
| } | ||
|
|
||
| func TestPnpmConfigFile(t *testing.T) { | ||
| tempDirPath := createTempEnv(t) | ||
| defer testsutils.RemoveAllAndAssert(t, tempDirPath) | ||
|
|
||
| context := createContext(t, resolutionServerId+"=relServer", resolutionRepo+"=repo", deploymentServerId+"=depServer", deploymentRepo+"=repo-local") | ||
| err := CreateBuildConfig(context, project.Pnpm) | ||
| assert.NoError(t, err) | ||
|
|
||
| config := checkCommonAndGetConfiguration(t, project.Pnpm.String(), tempDirPath) | ||
| assert.Equal(t, "relServer", config.GetString("resolver.serverId")) | ||
| assert.Equal(t, "repo", config.GetString("resolver.repo")) | ||
| assert.Equal(t, "depServer", config.GetString("deployer.serverId")) | ||
| assert.Equal(t, "repo-local", config.GetString("deployer.repo")) | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The file already has 4 near-identical func TestConfigFileWithDefaultServerId(t *testing.T) {
types := []project.ProjectType{
project.Go, project.Pip, project.Pipenv, project.Npm, project.Pnpm,
}
for _, confType := range types {
t.Run(confType.String(), func(t *testing.T) {
cleanUp, err := tests.ConfigTestServer(t)
assert.NoError(t, err)
defer cleanUp()
context := createContext(t, resolutionRepo+"=repo", deploymentRepo+"=repo-local")
err = CreateBuildConfig(context, confType)
assert.NoError(t, err)
config := checkCommonAndGetConfiguration(t, confType.String(), os.Getenv(coreutils.HomeDir))
assert.Equal(t, "test", config.GetString("resolver.serverId"))
assert.Equal(t, "repo", config.GetString("resolver.repo"))
assert.Equal(t, "test", config.GetString("deployer.serverId"))
assert.Equal(t, "repo-local", config.GetString("deployer.repo"))
})
}
}Is this PR the right scope for the refactor, or should it be a follow-up? Review generated by xray-pr-review |
||
|
|
||
| func TestRubyConfigFile(t *testing.T) { | ||
| // Set JFROG_CLI_HOME_DIR environment variable | ||
| tempDirPath := createTempEnv(t) | ||
|
|
||
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.
All 4 flags are set in this test, so
isInteractive()returnsfalse—handleInteractiveConfigCreationexits at line 156 before reachingcase project.Pnpm:. The new branch is not exercised by this test.Review generated by xray-pr-review