Skip to content

Commit

Permalink
Merge pull request konveyor#52 from aufi/add-tackletestapp-wdeps-tier0
Browse files Browse the repository at this point in the history
Move Testapp analysis with deps to tier0
  • Loading branch information
dymurray authored Nov 10, 2023
2 parents 85d9ad9 + 8d7a6b5 commit 5777b8a
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 35 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main-tier0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ jobs:
run: |
go install github.com/onsi/ginkgo/v2/ginkgo
- run: HUB_BASE_URL="http://$(minikube ip)/hub" DEBUG=1 make test-tier0
env:
MAVEN_TESTAPP_USER: ${{ secrets.MAVEN_TESTAPP_USER }}
MAVEN_TESTAPP_TOKEN: ${{ secrets.MAVEN_TESTAPP_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/nightly-tier0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ jobs:
run: |
go install github.com/onsi/ginkgo/v2/ginkgo
- run: HUB_BASE_URL="http://$(minikube ip)/hub" DEBUG=1 make test-tier0
env:
MAVEN_TESTAPP_USER: ${{ secrets.MAVEN_TESTAPP_USER }}
MAVEN_TESTAPP_TOKEN: ${{ secrets.MAVEN_TESTAPP_TOKEN }}
16 changes: 16 additions & 0 deletions analysis/analysis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ func TestApplicationAnalysis(t *testing.T) {
t.Parallel()
}

// Prepare Identities, e.g. for Maven repo
for _, identity := range tc.Identities {
if identity.Kind == "maven" {
strings.Replace(identity.Settings, "GITHUB_USER", os.Getenv("MAVEN_TESTAPP_USER"), 1)
strings.Replace(identity.Settings, "GITHUB_TOKEN", os.Getenv("MAVEN_TESTAPP_TOKEN"), 1)
}
assert.Should(t, RichClient.Identity.Create(&identity))
tc.Application.Identities = append(tc.Application.Identities, api.Ref{ID: identity.ID})
}

// Create the application.
uniq.ApplicationName(&tc.Application)
assert.Should(t, RichClient.Application.Create(&tc.Application))
Expand Down Expand Up @@ -226,6 +236,12 @@ func TestApplicationAnalysis(t *testing.T) {
if keep {
return
}

// Cleanup Identities.
for _, r := range tc.Application.Identities {
assert.Should(t, RichClient.Identity.Delete(r.ID))
}

// Cleanup Application.
assert.Must(t, RichClient.Application.Delete(tc.Application.ID))

Expand Down
1 change: 1 addition & 0 deletions analysis/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type TC struct {
// Application and other test data declaration.
Application api.Application // Required.
CustomRules []api.RuleSet
Identities []api.Identity
// Analysis parameters.
Task api.Task
TaskData string
Expand Down
62 changes: 28 additions & 34 deletions analysis/tc_tackle_testapp_public_deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ package analysis
import (
"github.com/konveyor/go-konveyor-tests/hack/addon"
"github.com/konveyor/tackle2-hub/api"
"github.com/konveyor/tackle2-hub/test/api/identity"
)

var MavenPublic = identity.Mvn

var TackleTestappPublicWithDeps = TC{
Name: "Tackle Testapp public with deps",
Application: TackleTestApp,
Expand All @@ -16,6 +19,9 @@ var TackleTestappPublicWithDeps = TC{
"konveyor.io/target=cloud-readiness",
},
},
Identities: []api.Identity{
MavenPublic, // Tackle Testapp public Maven registry expects MAVEN_TESTAPP_USER and MAVEN_TESTAPP_TOKEN env variables.
},
Analysis: api.Analysis{
Effort: 9,
Issues: []api.Issue{
Expand Down Expand Up @@ -84,49 +90,24 @@ var TackleTestappPublicWithDeps = TC{
},
},
Dependencies: []api.TechDependency{
{
Name: "com.fasterxml.jackson.jackson-bom",
Version: "${jackson.version}",
Provider: "",
},
{
Name: "org.springframework.data.spring-data-bom",
Version: "${spring-data.version}",
Provider: "",
},
{
Name: "org.apache.tomcat.tomcat-servlet-api",
Version: "${tomcat.version}",
Provider: "",
},
{
Name: "com.fasterxml.jackson.core.jackson-core",
Version: "",
Provider: "",
},
{
Name: "com.fasterxml.jackson.core.jackson-databind",
Version: "",
Provider: "",
},
{
Name: "org.springframework.data.spring-data-jpa",
Version: "",
Version: "9.0.46",
Provider: "",
},
{
Name: "org.springframework.spring-jdbc",
Version: "${spring-framework.version}",
Version: "5.3.7",
Provider: "",
},
{
Name: "org.springframework.spring-webmvc",
Version: "${spring-framework.version}",
Version: "5.3.7",
Provider: "",
},
{
Name: "org.springframework.spring-web",
Version: "${spring-framework.version}",
Version: "5.3.7",
Provider: "",
},
{
Expand All @@ -136,17 +117,17 @@ var TackleTestappPublicWithDeps = TC{
},
{
Name: "org.apache.tomcat.tomcat-jdbc",
Version: "${tomcat.version}",
Version: "9.0.46",
Provider: "",
},
{
Name: "org.hibernate.hibernate-entitymanager",
Version: "${hibernate.version}",
Version: "5.4.32.Final",
Provider: "",
},
{
Name: "org.hibernate.validator.hibernate-validator",
Version: "${hibernate-validator.version}",
Version: "6.2.0.Final",
Provider: "",
},
{
Expand Down Expand Up @@ -174,20 +155,33 @@ var TackleTestappPublicWithDeps = TC{
Version: "1.0.0",
Provider: "",
},
{
Name: "com.fasterxml.jackson.jackson-bom",
Version: "2.12.3",
Provider: "",
},
{
Name: "org.springframework.data.spring-data-bom",
Version: "2021.0.1",
Provider: "",
},
},
},
AnalysisTags: []api.Tag{
{Name: "EJB XML", Category: api.Ref{Name: "Bean"}},
{Name: "Servlet", Category: api.Ref{Name: "HTTP"}},
{Name: "Properties", Category: api.Ref{Name: "Other"}},
{Name: "Java EE Batch", Category: api.Ref{Name: "Processing"}},
{Name: "Java EE Batch", Category: api.Ref{Name: "Java EE"}},
{Name: "Spring Web", Category: api.Ref{Name: "Web"}},
{Name: "EJB XML", Category: api.Ref{Name: "Connect"}},
{Name: "Servlet", Category: api.Ref{Name: "Java EE"}},
{Name: "EJB XML", Category: api.Ref{Name: "Java EE"}},
{Name: "Properties", Category: api.Ref{Name: "Sustain"}},
{Name: "Properties", Category: api.Ref{Name: "Embedded"}},
{Name: "Java EE Batch", Category: api.Ref{Name: "Execute"}},
{Name: "EJB XML", Category: api.Ref{Name: "Connect"}},
{Name: "Java EE Batch", Category: api.Ref{Name: "Java EE"}},
{Name: "Servlet", Category: api.Ref{Name: "Connect"}},
{Name: "Spring Web", Category: api.Ref{Name: "View"}},
{Name: "Spring Web", Category: api.Ref{Name: "Embedded"}},
},
}
2 changes: 1 addition & 1 deletion analysis/test_cases.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package analysis
// List of applications with expected analysis outputs.
var Tier0TestCases = []TC{
TackleTestappPublic,
TackleTestappPublicWithDeps,
}

//
Expand All @@ -18,7 +19,6 @@ var Tier1TestCases = []TC{
// Tier 2 Analysis test cases - great if works.
// List of applications with expected analysis outputs.
var Tier2TestCases = []TC{
TackleTestappPublicWithDeps,
Tomcat,
Daytrader,
PetclinicHazelcast,
Expand Down

0 comments on commit 5777b8a

Please sign in to comment.