Skip to content

Commit

Permalink
Update TackleTestapp binary tests (#171)
Browse files Browse the repository at this point in the history
* Move TackletestApp binary fomr TIER0

Proposing partially revert PR#161 Testapp Binary test assignment to TIER0 to unblock CI on-PR checks that are holding our colleagues work in Konveyor repos from being merged.

The original PR#161 moved TackleTestapp Public "binary" test into TIER0 however it was _still failing_. The issue is already reported as https://issues.redhat.com/browse/MTA-3654, so I'd strongly prefer escalate the Jira issue to merging failing test.

Signed-off-by: Marek Aufart <maufart@redhat.com>

* Update TackleTestapp binary tests

Updating test for Tackle Testapp Public Binary analysis and related test
data.

Related to #161,
#169, replaces #168

Signed-off-by: Marek Aufart <maufart@redhat.com>

* Update test_cases names

Signed-off-by: Marek Aufart <maufart@redhat.com>

---------

Signed-off-by: Marek Aufart <maufart@redhat.com>
  • Loading branch information
aufi committed Sep 13, 2024
1 parent 663ebce commit 2d87e86
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 136 deletions.
2 changes: 1 addition & 1 deletion analysis/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func DumpTags(t *testing.T, tc TC, app api.Application) {
fmt.Printf("## GOT TAGS FOR \"%s\":", tc.Name)
fmt.Printf("\n[]api.Tag{\n")
for _, tag := range tags {
fmt.Printf(" {Name: \"%s\", Category: api.Ref{Name: \"%s\")},\n", tag.Name, tag.Category.Name)
fmt.Printf(" {Name: \"%s\", Category: api.Ref{Name: \"%s\"}},\n", tag.Name, tag.Category.Name)
}
fmt.Printf("}\n")
}
2 changes: 1 addition & 1 deletion analysis/tc_acmeair_webapp_upload_binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/konveyor/tackle2-hub/api"
)

var AcmeairWebapp = TC{
var AcmeairWebappBinary = TC{
Name: "acmeair-webapp",
Application: data.UploadBinary,
Task: Analyze,
Expand Down
2 changes: 1 addition & 1 deletion analysis/tc_administracion_efectivo_upload_binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/konveyor/tackle2-hub/api"
)

var AdministracionEfectivo = TC{
var AdministracionEfectivoBinary = TC{
Name: "administracion-efectivo",
Application: data.UploadBinary,
Task: Analyze,
Expand Down
69 changes: 10 additions & 59 deletions analysis/tc_tackle_testapp_public_binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (

var TackleTestappPublicBinary = TC{
Name: "tackle-testapp-binary",
Application: data.TackleTestappPublic,
Application: data.TackleTestappPublicBinary,
Identities: []api.Identity{
identity.MavenPublic,
identity.TackleTestappPublicMaven,
},
Task: Analyze,
Labels: addon.Labels{
Expand All @@ -21,22 +21,8 @@ var TackleTestappPublicBinary = TC{
},
Binary: true,
Analysis: api.Analysis{
Effort: 15,
Effort: 1,
Issues: []api.Issue{
{
Category: "mandatory",
Description: "Java native libraries (JNI, JNA)",
Effort: 7,
RuleSet: "cloud-readiness",
Rule: "jni-native-code-00000",
Incidents: []api.Incident{
{
File: "/shared/bin/maven/java-project/src/main/java/io/konveyor/demo/config/ApplicationConfiguration.java",
Line: 17,
Message: "Java native libraries might not run in a cloud or container environment.",
},
},
},
{
Category: "mandatory",
Description: "File system - Java IO",
Expand All @@ -45,58 +31,23 @@ var TackleTestappPublicBinary = TC{
Rule: "local-storage-00001",
Incidents: []api.Incident{
{
File: "/shared/bin/maven/java-project/src/main/java/io/konveyor/demo/config/ApplicationConfiguration.java",
Line: 8,
Message: "An application running inside a container could lose access to a file in local storage.",
},
{
File: "/shared/bin/maven/java-project/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 39,
Message: "An application running inside a container could lose access to a file in local storage.",
},
{
File: "/shared/bin/maven/java-project/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 40,
Message: "An application running inside a container could lose access to a file in local storage.",
},
{
File: "/shared/bin/maven/java-project/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 41,
Message: "An application running inside a container could lose access to a file in local storage.",
},
{
File: "/shared/bin/maven/java-project/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 42,
Message: "An application running inside a container could lose access to a file in local storage.",
},
{
File: "/shared/bin/maven/java-project/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 61,
Message: "An application running inside a container could lose access to a file in local storage.",
},
{
File: "/shared/bin/maven/java-project/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 62,
Message: "An application running inside a container could lose access to a file in local storage.",
},
{
File: "/shared/bin/maven/java-project/src/main/java/io/konveyor/demo/ordermanagement/exception/handler/ExceptionHandlingController.java",
Line: 20,
File: "/shared/bin/java-project/src/main/java/io/konveyor/demo/config/ApplicationConfiguration.java",
Line: 14,
Message: "An application running inside a container could lose access to a file in local storage.",
},
},
},
},
},
AnalysisTags: []api.Tag{
{Name: "EJB XML", Category: api.Ref{Name: "Bean"}},
{Name: "Servlet", Category: api.Ref{Name: "HTTP"}},
{Name: "JNI", Category: api.Ref{Name: "Other"}},
{Name: "Servlet", Category: api.Ref{Name: "Connect"}},
{Name: "JNI", Category: api.Ref{Name: "Connect"}},
{Name: "Servlet", Category: api.Ref{Name: "Java EE"}},
{Name: "JNI", Category: api.Ref{Name: "Java EE"}},
{Name: "JPA named queries", Category: api.Ref{Name: "Persistence"}},
{Name: "EJB XML", Category: api.Ref{Name: "Connect"}},
{Name: "EJB XML", Category: api.Ref{Name: "Java EE"}},
{Name: "JPA named queries", Category: api.Ref{Name: "Java EE"}},
{Name: "Servlet", Category: api.Ref{Name: "Java EE"}},
{Name: "Servlet", Category: api.Ref{Name: "Connect"}},
{Name: "JPA named queries", Category: api.Ref{Name: "Store"}},
},
}
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 @@ -19,7 +19,7 @@ var TackleTestappPublicWithDeps = TC{
},
},
Identities: []api.Identity{
identity.MavenPublic,
identity.TackleTestappPublicMaven,
},
Analysis: api.Analysis{
Effort: 2,
Expand Down
5 changes: 3 additions & 2 deletions analysis/test_cases.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ package analysis
var Tier0TestCases = []TC{
TackleTestappPublicWithDeps,
TackleTestappPublicPackageFilter,
AcmeairWebapp,
Tomcat,
AdministracionEfectivo,
AcmeairWebappBinary, // Binary upload
AdministracionEfectivoBinary, // Binary upload
TackleTestappPublicBinary, // Binary fetched from tackle-testapp-public maven registry
}

// Tier 1 Analysis test cases - should work.
Expand Down
18 changes: 13 additions & 5 deletions data/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ var (
Minimal = api.Application{
Name: "Minimal application",
}

// Repository-based applications
PathfinderGit = api.Application{
Name: "Pathfinder",
Description: "Tackle Pathfinder application.",
Expand All @@ -32,10 +34,6 @@ var (
Kind: "git",
URL: "https://github.com/konveyor/tackle-testapp-public",
},
Binary: "io.konveyor.demo:customers-tomcat:0.0.1-SNAPSHOT:war",
}
UploadBinary = api.Application{
Name: "upload-binary",
}
CustomerTomcatLegacy = api.Application{
Name: "Customer Tomcat Legacy",
Expand All @@ -45,5 +43,15 @@ var (
Path: "example-1",
},
}
ApplicationSamples = []api.Application{Minimal, PathfinderGit, BookServer, TackleTestappPublic, UploadBinary, CustomerTomcatLegacy}

// Binary applications
TackleTestappPublicBinary = api.Application{
Name: "Tackle Testapp public binary",
Binary: "mvn://io.konveyor.demo:customers-tomcat:0.0.1-SNAPSHOT:war", // To be downloaded from maven repository
}
UploadBinary = api.Application{
Name: "upload-binary", // The file itself to be uploaded during the test
}

ApplicationSamples = []api.Application{Minimal, PathfinderGit, BookServer, TackleTestappPublic, CustomerTomcatLegacy, TackleTestappPublicBinary, UploadBinary}
)
66 changes: 0 additions & 66 deletions data/identity/identity.go

This file was deleted.

115 changes: 115 additions & 0 deletions data/identity/maven.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
package identity

import (
"github.com/konveyor/tackle2-hub/api"
)

var TackleTestappPrivateMaven = api.Identity{
Kind: "maven",
Name: "maven-creds",
Settings: `<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.0.xsd">
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
<server>
<id>tackle-testapp</id>
<username>GITHUB_USER</username>
<password>GITHUB_TOKEN</password>
</server>
</servers>
<mirrors>
<mirror>
<id>maven-default-http-blocker</id>
<mirrorOf>external:http:*</mirrorOf>
<name>Pseudo repository to mirror external repositories initially using HTTP.</name>
<url>http://0.0.0.0/</url>
<blocked>true</blocked>
</mirror>
</mirrors>
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>tackle-testapp</id>
<url>https://maven.pkg.github.com/konveyor/tackle-testapp</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
</settings>`,
}

var TackleTestappPublicMaven = api.Identity{
Kind: "maven",
Name: "maven-testapp-public-creds",
Settings: `<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.0.xsd">
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
<server>
<id>tackle-testapp-public</id>
<username>GITHUB_USER</username>
<password>GITHUB_TOKEN</password>
</server>
</servers>
<mirrors>
<mirror>
<id>maven-default-http-blocker</id>
<mirrorOf>external:http:*</mirrorOf>
<name>Pseudo repository to mirror external repositories initially using HTTP.</name>
<url>http://0.0.0.0/</url>
<blocked>true</blocked>
</mirror>
</mirrors>
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>tackle-testapp-public</id>
<url>https://maven.pkg.github.com/konveyor/tackle-testapp-public</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
</settings>`,
}

0 comments on commit 2d87e86

Please sign in to comment.