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