diff --git a/tools/fotff/fotff.ini b/tools/fotff/fotff.ini new file mode 100644 index 0000000000000000000000000000000000000000..08e6ba9131b9477ec56fca4d637d5d4e9459485f --- /dev/null +++ b/tools/fotff/fotff.ini @@ -0,0 +1,58 @@ +pkg_manager = mock +tester = mock + +[pprof] +enable = true +port = 8080 + +[mail] +host = smtp.example.com +port = 465 +user = admin +password = password +from = admin@example.com +to = alice@example.com,bob@example.com + +[proxy] +server_list = +user = +password = + +[resources] +device_sn_list = 7001005458323933328a01fce1dc3800 +build_server_addr_list = 127.0.0.1:22 +build_server_user = root +build_server_password = root +build_server_workspace = /root/fotff/build_workspace + +[dayu200] +archive_dir = C:\dayu200 +watch_ci = false +workspace = C:\dayu200_workspace +location_id_list = 110 +branch = master +manifest_branch = master +flash_tool = ./pkg/dayu200/upgrade_tool.exe + +[gitee_build] +archive_dir = C:\dayu200 +workspace = C:\dayu200_workspace +branch = master +manifest_branch = master +component = dayu200_asan +pre_compile_cmd = rm -rf out*; ./build/prebuilts_download.sh +compile_cmd = ./build/common/asan/build_mixed_asan.sh --product-name rk3568 --ccache -g5:foundation,graphic,distributed_data -g2:appspawn --build-variant root -g0:access_token,accessibility,accountmgr,audio_policy,avsession_service,bgtaskmgr_service,bluetooth_service,bytrace,camera_service,cert_manager_service,console,dcamera,device_manager,device_usage_statistics_service,deviceauth_service,deviceinfoservice,dhardware,distributed_data,distributedbms,distributedfile,distributedsched,downloadservice,dscreen,dslm_service,edm,faultloggerd,hidumper_service,hilogd,hitrace,hiview,huks_service,inputmethodservice,installs,locationsa,media_service,memmgrservice,msdp_musl,multimodalinput,netmanager_base,netsysnative,nwebspawn,param_watcher,pinauth_sa_profile,privacy,pulseaudio,quick_fix,samgr_standard,sensors_musl,storage_daemon,sys_installer_sa,telephony,thermal_protector,timeservice,ui_service,wifi_hal_service,wifi_standard +image_list = out/rk3568/packages/phone/images/uboot.img + +[xdevice] +task = acts +config = ./config/user_config.xml +test_cases_path = ./testcases +resource_path = ./resource + +[smoke] +py = ./smoke/resource/capturescreentest.py +config = ./smoke/resource/app_capture_screen_test_config.json +answer_path = ./smoke/resource +save_path = ./smoke/save +tools_path = ./smoke diff --git a/tools/fotff/pkg/dayu200/dayu200.go b/tools/fotff/pkg/dayu200/dayu200.go index b02a9de8a5c791c21482c7950b7848173ab40127..986c8a14d88d2d2f05ea898c24afbf988e114abd 100644 --- a/tools/fotff/pkg/dayu200/dayu200.go +++ b/tools/fotff/pkg/dayu200/dayu200.go @@ -31,6 +31,7 @@ type Manager struct { WatchCI string `key:"watch_ci" default:"false"` Workspace string `key:"workspace" default:"workspace"` Branch string `key:"branch" default:"master"` + ManifestBranch string `key:"manifest_branch" default:"master"` FlashTool string `key:"flash_tool" default:"python"` LocationIDList string `key:"location_id_list"` @@ -71,7 +72,7 @@ func NewManager() pkg.Manager { if err != nil { logrus.Panicf("can not parse 'watch_ci', please check") } - ret.Manager = gitee_common.NewManager("dayu200", ret.Branch, ret.ArchiveDir, ret.Workspace, watchCI) + ret.Manager = gitee_common.NewManager("dayu200", ret.Branch, ret.ManifestBranch, ret.ArchiveDir, ret.Workspace, watchCI) devs := res.DeviceList() locs := strings.Split(ret.LocationIDList, ",") if len(devs) != len(locs) { diff --git a/tools/fotff/pkg/dayu200/upgrade_tool.exe b/tools/fotff/pkg/dayu200/upgrade_tool.exe new file mode 100644 index 0000000000000000000000000000000000000000..61030691d5beff7b436a93cac5db7ff4a4f0360a Binary files /dev/null and b/tools/fotff/pkg/dayu200/upgrade_tool.exe differ diff --git a/tools/fotff/pkg/gitee_build/gitee_build.go b/tools/fotff/pkg/gitee_build/gitee_build.go index ad24018940c9d0c0830b445d5d91c97b1d200470..11bbfd4c779d1bed7236116d1a320d2b2a4a8c86 100644 --- a/tools/fotff/pkg/gitee_build/gitee_build.go +++ b/tools/fotff/pkg/gitee_build/gitee_build.go @@ -25,13 +25,14 @@ import ( ) type Manager struct { - ArchiveDir string `key:"archive_dir" default:"archive"` - Workspace string `key:"workspace" default:"workspace"` - Branch string `key:"branch" default:"master"` - Component string `key:"component"` - PreCompileCMD string `key:"pre_compile_cmd"` - CompileCMD string `key:"compile_cmd"` - ImageList []string `key:"image_list"` + ArchiveDir string `key:"archive_dir" default:"archive"` + Workspace string `key:"workspace" default:"workspace"` + Branch string `key:"branch" default:"master"` + ManifestBranch string `key:"manifest_branch" default:"master"` + Component string `key:"component"` + PreCompileCMD string `key:"pre_compile_cmd"` + CompileCMD string `key:"compile_cmd"` + ImageList []string `key:"image_list"` *gitee_common.Manager } @@ -39,7 +40,7 @@ type Manager struct { func NewManager() pkg.Manager { var ret Manager utils.ParseFromConfigFile("gitee_build", &ret) - ret.Manager = gitee_common.NewManager(ret.Component, ret.Branch, ret.ArchiveDir, ret.Workspace, true) + ret.Manager = gitee_common.NewManager(ret.Component, ret.Branch, ret.ManifestBranch, ret.ArchiveDir, ret.Workspace, true) return &ret } diff --git a/tools/fotff/pkg/gitee_common/common.go b/tools/fotff/pkg/gitee_common/common.go index 045c1b749e17e73ac1fe7de9bec7b725fb2302f2..18330d4f520ac53ad491c49ffd751125e2d9d0ca 100644 --- a/tools/fotff/pkg/gitee_common/common.go +++ b/tools/fotff/pkg/gitee_common/common.go @@ -28,20 +28,22 @@ import ( ) type Manager struct { - Component string - Branch string - ArchiveDir string - Workspace string - WatchCI bool + Component string + Branch string + ManifestBranch string + ArchiveDir string + Workspace string + WatchCI bool } -func NewManager(component string, branch string, archiveDir string, workspace string, watchCI bool) *Manager { +func NewManager(component string, branch string, manifestBranch string, archiveDir string, workspace string, watchCI bool) *Manager { var ret = Manager{ - Component: component, - Branch: branch, - ArchiveDir: archiveDir, - Workspace: workspace, - WatchCI: watchCI, + Component: component, + Branch: branch, + ManifestBranch: manifestBranch, + ArchiveDir: archiveDir, + Workspace: workspace, + WatchCI: watchCI, } go ret.cleanupOutdated() return &ret diff --git a/tools/fotff/pkg/gitee_common/get_newer_ci.go b/tools/fotff/pkg/gitee_common/get_newer_ci.go index f5b3495a0b9a0e0b9cffb817783998bbfa062c1f..33fa9881a8c9c652625f4c77a79f1fadd7ce415b 100644 --- a/tools/fotff/pkg/gitee_common/get_newer_ci.go +++ b/tools/fotff/pkg/gitee_common/get_newer_ci.go @@ -90,7 +90,7 @@ func (m *Manager) loopCI(param DailyBuildsQueryParam, cur string, getFn func(cur func (m *Manager) getNewerFromCI(cur string) string { return m.loopCI(DailyBuildsQueryParam{ ProjectName: "openharmony", - Branch: m.Branch, + Branch: m.ManifestBranch, Component: m.Component, BuildStatus: "success", PageNum: 1, diff --git a/tools/fotff/pkg/gitee_common/get_newer_or_fail.go b/tools/fotff/pkg/gitee_common/get_newer_or_fail.go index 03730f55316d4c6fa8193b1de223de0b7424ea8a..d6b8ef230d5ed88c62e6fd4e5ae9f5457a6ede2a 100644 --- a/tools/fotff/pkg/gitee_common/get_newer_or_fail.go +++ b/tools/fotff/pkg/gitee_common/get_newer_or_fail.go @@ -46,7 +46,7 @@ func (m *Manager) GetNewerOrFail(cur string) (string, error) { func (m *Manager) getNewerOrFailFromCI(cur string) string { return m.loopCI(DailyBuildsQueryParam{ ProjectName: "openharmony", - Branch: m.Branch, + Branch: m.ManifestBranch, Component: m.Component, PageNum: 1, PageSize: 1, @@ -79,7 +79,7 @@ func (m *Manager) getNewerDailyBuildOrFail(cur string, db *DailyBuild) string { func (m *Manager) genFailedPackage(lastSuccessTime, failedBuildStartTime time.Time) string { pkg := fmt.Sprintf("%s_%s_build_fail", m.Component, failedBuildStartTime.Format("20060102_150405")) - logrus.Infof("getting failed package manifest for %s(%s) at %s", m.Component, m.Branch, failedBuildStartTime) + logrus.Infof("getting failed package manifest for %s(%s) at %s", m.Component, m.ManifestBranch, failedBuildStartTime) tags, err := m.getAllTags(lastSuccessTime, failedBuildStartTime) if err != nil { logrus.Errorf("can not get latest tag from ci, err: %v", err) diff --git a/tools/fotff/pkg/gitee_common/steps_ci.go b/tools/fotff/pkg/gitee_common/steps_ci.go index 36cdd9e7280a4b23f82add9bc47f508067da5cb1..b45682d941af8b16f48c152618774799a9cf5357 100644 --- a/tools/fotff/pkg/gitee_common/steps_ci.go +++ b/tools/fotff/pkg/gitee_common/steps_ci.go @@ -85,7 +85,7 @@ func (m *Manager) getAllTags(from, to time.Time) (ret []*Tag, err error) { for { var q = TagQueryParam{ ProjectName: "openharmony", - Branch: m.Branch, + Branch: m.ManifestBranch, ManifestFile: "default.xml", StartTime: from.Local().Format("2006-01-02"), EndTime: to.Local().Format("2006-01-02"), diff --git a/tools/fotff/pkg/gitee_common/steps_gitee.go b/tools/fotff/pkg/gitee_common/steps_gitee.go index 11899fddb33d7e0670802652bbfa90b3e1622762..27540353ce845baf6795693b8168f9d484bca368 100644 --- a/tools/fotff/pkg/gitee_common/steps_gitee.go +++ b/tools/fotff/pkg/gitee_common/steps_gitee.go @@ -63,7 +63,7 @@ func (m *Manager) stepsFromGitee(from, to string) (pkgs []string, err error) { return nil, err } logrus.Infof("find %d repo updates from %s to %s", len(updates), from, to) - steps, err := getAllStepsFromGitee(startTime, endTime, m.Branch, updates) + steps, err := getAllStepsFromGitee(startTime, endTime, m.Branch, m.ManifestBranch, updates) if err != nil { return nil, err } @@ -94,8 +94,8 @@ func (m *Manager) getRepoUpdates(from, to string) (updates []vcs.ProjectUpdate, return vcs.GetRepoUpdates(m1, m2) } -func getAllStepsFromGitee(startTime, endTime time.Time, branch string, updates []vcs.ProjectUpdate) (ret []Step, err error) { - allMRs, err := getAllMRs(startTime, endTime, branch, updates) +func getAllStepsFromGitee(startTime, endTime time.Time, branch string, manifestBranch string, updates []vcs.ProjectUpdate) (ret []Step, err error) { + allMRs, err := getAllMRs(startTime, endTime, branch, manifestBranch, updates) if err != nil { return nil, err } @@ -106,13 +106,13 @@ func getAllStepsFromGitee(startTime, endTime time.Time, branch string, updates [ return combineIssuesToStep(issueInfos) } -func getAllMRs(startTime, endTime time.Time, branch string, updates []vcs.ProjectUpdate) (allMRs []*gitee.Commit, err error) { +func getAllMRs(startTime, endTime time.Time, branch string, manifestBranch string, updates []vcs.ProjectUpdate) (allMRs []*gitee.Commit, err error) { var once sync.Once for _, update := range updates { var prs []*gitee.Commit if update.P1.StructureDiff(update.P2) { once.Do(func() { - prs, err = gitee.GetBetweenTimeMRs("openharmony", "manifest", branch, startTime, endTime) + prs, err = gitee.GetBetweenTimeMRs("openharmony", "manifest", manifestBranch, startTime, endTime) }) if update.P1 != nil { var p1 []*gitee.Commit