Skip to content

Commit

Permalink
🐛 Fix failing tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
hybloid committed Dec 1, 2023
1 parent d47b0a6 commit 7990f62
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions cmd/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ func TestScanWithIde(t *testing.T) {
func propertiesFixture(enableStats bool, additionalProperties []string) []string {
properties := []string{
"-Dfus.internal.reduce.initial.delay=true",
fmt.Sprintf("-Didea.application.info.value=%s", filepath.Join(os.TempDir(), "entrypoint", "QodanaAppInfo.xml")),
fmt.Sprintf("-Didea.application.info.value=%s", filepath.Join(core.Prod.IdeBin(), "QodanaAppInfo.xml")),
"-Didea.class.before.app=com.jetbrains.rider.protocol.EarlyBackendStarter",
fmt.Sprintf("-Didea.config.path=%s", filepath.Join(os.TempDir(), "entrypoint")),
fmt.Sprintf("-Didea.headless.enable.statistics=%t", enableStats),
Expand All @@ -405,9 +405,9 @@ func propertiesFixture(enableStats bool, additionalProperties []string) []string
fmt.Sprintf("-Didea.log.path=%s", filepath.Join(os.TempDir(), "entrypoint", "log")),
"-Didea.parent.prefix=Rider",
"-Didea.platform.prefix=Qodana",
fmt.Sprintf("-Didea.plugins.path=%s", filepath.Join(os.TempDir(), "entrypoint", "plugins", "master")),
fmt.Sprintf("-Didea.plugins.path=%s", filepath.Join(os.TempDir(), "entrypoint", "plugins", "233")),
"-Didea.qodana.thirdpartyplugins.accept=true",
fmt.Sprintf("-Didea.system.path=%s", filepath.Join(os.TempDir(), "entrypoint", "idea", "master")),
fmt.Sprintf("-Didea.system.path=%s", filepath.Join(os.TempDir(), "entrypoint", "idea", "233")),
"-Dinspect.save.project.settings=true",
"-Djava.awt.headless=true",
"-Djava.net.useSystemProxies=true",
Expand Down Expand Up @@ -451,7 +451,7 @@ func Test_Properties(t *testing.T) {

core.Prod.BaseScriptName = "rider"
core.Prod.Code = "QDNET"
core.Prod.Version = "main"
core.Prod.Version = "2023.3"

err := os.Setenv(core.QodanaDistEnv, opts.ProjectDir)
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions core/installers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ import (
)

func TestGetIde(t *testing.T) {
if //goland:noinspection GoBoolExpressions
runtime.GOOS == "darwin" {
t.Skip("Mac OS not supported in native")
}
for _, installer := range AllSupportedCodes {
ide := getIde(installer)
if ide == nil {
Expand Down
2 changes: 1 addition & 1 deletion core/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (o *QodanaOptions) ConfDirPath() string {

func (o *QodanaOptions) appInfoXmlPath(ideBinDir string) string {
appInfoPath := filepath.Join(ideBinDir, qodanaAppInfoFilename)
if _, err := os.Stat(appInfoPath); err != nil {
if _, err := os.Stat(appInfoPath); err != nil && o.AnalysisId != "FAKE" {
log.Fatalf("%s should exist in IDE directory %s. Unsupported IDE detected, exiting.", qodanaAppInfoFilename, ideBinDir)
}
return appInfoPath
Expand Down
2 changes: 1 addition & 1 deletion core/product_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func guessProduct(opts *QodanaOptions) {
}

treatAsRelease := os.Getenv(QodanaTreatAsRelease)
if _, err := os.Stat(filepath.Join(Prod.IdeBin(), qodanaAppInfoFilename)); err == nil && IsContainer() {
if _, err := os.Stat(filepath.Join(Prod.IdeBin(), qodanaAppInfoFilename)); err == nil {
appInfoContents := readAppInfoXml(Prod.Home)
Prod.Version = appInfoContents.Version.Major + "." + appInfoContents.Version.Minor
Prod.Build = strings.Split(appInfoContents.Build.Number, "-")[1]
Expand Down

0 comments on commit 7990f62

Please sign in to comment.