mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-28 03:30:01 +08:00
change: trigger actions on push to main branch
This commit is contained in:
@@ -2,6 +2,8 @@ name: Run scaffold for hrp
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [synchronize]
|
types: [synchronize]
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ name: run smoke tests for httprunner
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [synchronize]
|
types: [synchronize]
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ name: Run unittests
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [synchronize]
|
types: [synchronize]
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -153,7 +153,7 @@ var demoTestCaseWithoutPlugin = &TestCase{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGenDemoTestCase(t *testing.T) {
|
func TestGenDemoTestCase(t *testing.T) {
|
||||||
tCase := convertTestCase(demoTestCaseWithPlugin)
|
tCase := demoTestCaseWithPlugin.ToTCase()
|
||||||
err := builtin.Dump2JSON(tCase, demoTestCaseWithPluginJSONPath.GetPath())
|
err := builtin.Dump2JSON(tCase, demoTestCaseWithPluginJSONPath.GetPath())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fail()
|
t.Fail()
|
||||||
@@ -163,7 +163,7 @@ func TestGenDemoTestCase(t *testing.T) {
|
|||||||
t.Fail()
|
t.Fail()
|
||||||
}
|
}
|
||||||
|
|
||||||
tCase = convertTestCase(demoTestCaseWithoutPlugin)
|
tCase = demoTestCaseWithoutPlugin.ToTCase()
|
||||||
err = builtin.Dump2JSON(tCase, demoTestCaseWithoutPluginJSONPath.GetPath())
|
err = builtin.Dump2JSON(tCase, demoTestCaseWithoutPluginJSONPath.GetPath())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fail()
|
t.Fail()
|
||||||
|
|||||||
+3
-3
@@ -323,11 +323,11 @@ func (tc *TestCase) ToTestCase() (*TestCase, error) {
|
|||||||
return tc, nil
|
return tc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func convertTestCase(testcase *TestCase) *TCase {
|
func (tc *TestCase) ToTCase() *TCase {
|
||||||
tCase := &TCase{
|
tCase := &TCase{
|
||||||
Config: testcase.Config,
|
Config: tc.Config,
|
||||||
}
|
}
|
||||||
for _, step := range testcase.TestSteps {
|
for _, step := range tc.TestSteps {
|
||||||
tCase.TestSteps = append(tCase.TestSteps, step.ToStruct())
|
tCase.TestSteps = append(tCase.TestSteps, step.ToStruct())
|
||||||
}
|
}
|
||||||
return tCase
|
return tCase
|
||||||
|
|||||||
+2
-2
@@ -567,7 +567,7 @@ func (r *caseRunner) runStepRendezvous(rendezvous *Rendezvous) (stepResult *step
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *caseRunner) isPreRendezvousAllReleased(rendezvous *Rendezvous) bool {
|
func (r *caseRunner) isPreRendezvousAllReleased(rendezvous *Rendezvous) bool {
|
||||||
tCase := convertTestCase(r.TestCase)
|
tCase := r.TestCase.ToTCase()
|
||||||
for _, step := range tCase.TestSteps {
|
for _, step := range tCase.TestSteps {
|
||||||
preRendezvous := step.Rendezvous
|
preRendezvous := step.Rendezvous
|
||||||
if preRendezvous == nil {
|
if preRendezvous == nil {
|
||||||
@@ -614,7 +614,7 @@ func (r *Rendezvous) setReleased() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func initRendezvous(testcase *TestCase, total int64) []*Rendezvous {
|
func initRendezvous(testcase *TestCase, total int64) []*Rendezvous {
|
||||||
tCase := convertTestCase(testcase)
|
tCase := testcase.ToTCase()
|
||||||
var rendezvousList []*Rendezvous
|
var rendezvousList []*Rendezvous
|
||||||
for _, step := range tCase.TestSteps {
|
for _, step := range tCase.TestSteps {
|
||||||
if step.Rendezvous == nil {
|
if step.Rendezvous == nil {
|
||||||
|
|||||||
+2
-2
@@ -287,12 +287,12 @@ func TestRunCaseWithRefAPI(t *testing.T) {
|
|||||||
|
|
||||||
func TestLoadTestCases(t *testing.T) {
|
func TestLoadTestCases(t *testing.T) {
|
||||||
// load test cases from folder path
|
// load test cases from folder path
|
||||||
tc := TestCasePath(templatesDir + "testcases")
|
tc := TestCasePath("../examples/demo-with-py-plugin/testcases/")
|
||||||
testCases, err := loadTestCases(&tc)
|
testCases, err := loadTestCases(&tc)
|
||||||
if !assert.Nil(t, err) {
|
if !assert.Nil(t, err) {
|
||||||
t.Fail()
|
t.Fail()
|
||||||
}
|
}
|
||||||
if !assert.GreaterOrEqual(t, len(testCases), 5) {
|
if !assert.Equal(t, len(testCases), 3) {
|
||||||
t.Fail()
|
t.Fail()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user