Skip to content

Commit

Permalink
Update analysis test Incident Paths and TaskData
Browse files Browse the repository at this point in the history
Updating expected incident paths, that was influenced by recent changes
and changing analysis test cases usage of default TaskData.

Depends on konveyor#130

Signed-off-by: Marek Aufart <maufart@redhat.com>
  • Loading branch information
aufi committed Jun 10, 2024
1 parent 2423c5b commit 9a2a05b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
3 changes: 1 addition & 2 deletions analysis/analysis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"time"

"github.com/k0kubun/pp"
"github.com/konveyor/go-konveyor-tests/hack/addon"
"github.com/konveyor/go-konveyor-tests/hack/uniq"
"github.com/konveyor/tackle2-hub/api"
"github.com/konveyor/tackle2-hub/binding"
Expand Down Expand Up @@ -92,7 +91,7 @@ func TestApplicationAnalysis(t *testing.T) {
// Prepare and submit the analyze task.
// tc.Task.Addon = analyzerAddon
tc.Task.Application = &api.Ref{ID: tc.Application.ID}
taskData := tc.Task.Data.(addon.Data)
taskData := AnalyzeDataDefault
//for _, r := range tc.CustomRules {
// taskData.Rules = append(taskData.Rules, api.Ref{ID: r.ID, Name: r.Name})
//}
Expand Down
3 changes: 1 addition & 2 deletions analysis/analyzer_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import (

var Analyze = api.Task{
State: "Created", // Created / Ready
Data: defaultAnalyzerData,
Addon: "analyzer",
}

var defaultAnalyzerData = addon.Data{
var AnalyzeDataDefault = addon.Data{
Output: "/windup/report",
Mode: addon.Mode{
Artifact: "",
Expand Down
16 changes: 8 additions & 8 deletions analysis/tc_tackle_testapp_public.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var TackleTestappPublic = TC{
Rule: "hardcoded-ip-address",
Incidents: []api.Incident{
{
File: "/addon/source/tackle-testapp-public/src/main/resources/persistence.properties",
File: "/shared/source/tackle-testapp-public/src/main/resources/persistence.properties",
Line: 2,
Message: "When migrating environments, hard-coded IP addresses may need to be modified or eliminated.",
CodeSnip: "jdbc.url=jdbc:oracle:thin:@10.19.2.93:15",
Expand All @@ -51,43 +51,43 @@ var TackleTestappPublic = TC{
Rule: "local-storage-00001",
Incidents: []api.Incident{
{
File: "/addon/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
File: "/shared/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 45,
Message: "An application running inside a container could lose access to a file in local storage.. Recommendations. The following recommendations depend on the function of the file in local storage:. * Logging: Log to standard output and use a centralized log collector to analyze the logs.. * Caching: Use a cache backing service.. * Configuration: Store configuration settings in environment variables so that they can be updated without code changes.. * Data storage: Use a database backing service for relational data or use a persistent data storage system.. * Temporary data storage: Use the file system of a running container as a brief, single-transaction cache.",
CodeSnip: "dataSource.setDriverClassName(config.getProperty(\"jdbc.driverClassName\"));",
},
{
File: "/addon/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
File: "/shared/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 46,
Message: "An application running inside a container could lose access to a file in local storage.. Recommendations. The following recommendations depend on the function of the file in local storage:. * Logging: Log to standard output and use a centralized log collector to analyze the logs.. * Caching: Use a cache backing service.. * Configuration: Store configuration settings in environment variables so that they can be updated without code changes.. * Data storage: Use a database backing service for relational data or use a persistent data storage system.. * Temporary data storage: Use the file system of a running container as a brief, single-transaction cache.",
CodeSnip: "dataSource.setUrl(config.getProperty(\"jdbc.url\"));",
},
{
File: "/addon/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
File: "/shared/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 47,
Message: "An application running inside a container could lose access to a file in local storage.. Recommendations. The following recommendations depend on the function of the file in local storage:. * Logging: Log to standard output and use a centralized log collector to analyze the logs.. * Caching: Use a cache backing service.. * Configuration: Store configuration settings in environment variables so that they can be updated without code changes.. * Data storage: Use a database backing service for relational data or use a persistent data storage system.. * Temporary data storage: Use the file system of a running container as a brief, single-transaction cache.",
CodeSnip: "dataSource.setUsername(config.getProperty(\"jdbc.user\"));",
},
{
File: "/addon/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
File: "/shared/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 48,
Message: "An application running inside a container could lose access to a file in local storage.. Recommendations. The following recommendations depend on the function of the file in local storage:. * Logging: Log to standard output and use a centralized log collector to analyze the logs.. * Caching: Use a cache backing service.. * Configuration: Store configuration settings in environment variables so that they can be updated without code changes.. * Data storage: Use a database backing service for relational data or use a persistent data storage system.. * Temporary data storage: Use the file system of a running container as a brief, single-transaction cache.",
CodeSnip: "dataSource.setPassword(config.getProperty(\"jdbc.password\"));",
},
{
File: "/addon/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
File: "/shared/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 56,
Message: "An application running inside a container could lose access to a file in local storage.. Recommendations. The following recommendations depend on the function of the file in local storage:. * Logging: Log to standard output and use a centralized log collector to analyze the logs.. * Caching: Use a cache backing service.. * Configuration: Store configuration settings in environment variables so that they can be updated without code changes.. * Data storage: Use a database backing service for relational data or use a persistent data storage system.. * Temporary data storage: Use the file system of a running container as a brief, single-transaction cache.",
CodeSnip: "transactionManager.setEntityManagerFactory(",
},
{
File: "/addon/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
File: "/shared/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 68,
Message: "An application running inside a container could lose access to a file in local storage.. Recommendations. The following recommendations depend on the function of the file in local storage:. * Logging: Log to standard output and use a centralized log collector to analyze the logs.. * Caching: Use a cache backing service.. * Configuration: Store configuration settings in environment variables so that they can be updated without code changes.. * Data storage: Use a database backing service for relational data or use a persistent data storage system.. * Temporary data storage: Use the file system of a running container as a brief, single-transaction cache.",
CodeSnip: "hibernateProperties.setProperty(\"hibernate.hbm2ddl.auto\", config.getProperty(\"hibernate.hbm2ddl.auto\"));",
},
{
File: "/addon/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
File: "/shared/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 69,
Message: "An application running inside a container could lose access to a file in local storage.. Recommendations. The following recommendations depend on the function of the file in local storage:. * Logging: Log to standard output and use a centralized log collector to analyze the logs.. * Caching: Use a cache backing service.. * Configuration: Store configuration settings in environment variables so that they can be updated without code changes.. * Data storage: Use a database backing service for relational data or use a persistent data storage system.. * Temporary data storage: Use the file system of a running container as a brief, single-transaction cache.",
CodeSnip: "hibernateProperties.setProperty(\"hibernate.dialect\", config.getProperty(\"hibernate.dialect\"));",
Expand Down
2 changes: 1 addition & 1 deletion analysis/tc_tackle_testapp_public_deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var TackleTestappPublicWithDeps = TC{
Rule: "hardcoded-ip-address",
Incidents: []api.Incident{
{
File: "/addon/source/tackle-testapp-public/src/main/resources/persistence.properties",
File: "/shared/source/tackle-testapp-public/src/main/resources/persistence.properties",
Line: 2,
Message: "When migrating environments, hard-coded IP addresses may need to be modified or eliminated.",
CodeSnip: "jdbc.url=jdbc:oracle:thin:@10.19.2.93:15",
Expand Down
2 changes: 1 addition & 1 deletion analysis/tc_tackle_testapp_public_package_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var TackleTestappPublicPackageFilter = TC{
Rule: "hardcoded-ip-address",
Incidents: []api.Incident{
{
File: "/addon/source/tackle-testapp-public/src/main/resources/persistence.properties",
File: "/shared/source/tackle-testapp-public/src/main/resources/persistence.properties",
Line: 2,
Message: "When migrating environments, hard-coded IP addresses may need to be modified or eliminated.",
CodeSnip: "jdbc.url=jdbc:oracle:thin:@10.19.2.93:15",
Expand Down

0 comments on commit 9a2a05b

Please sign in to comment.