-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/teacher #3
Feat/teacher #3
Conversation
Use selenium(chrome) to pass jaccount's Oauth and should input the validation code by hand.
…file.py. Usage: python teacher-profile.py -n=<jaccount> -p=<password> --limit=5000
And write simple test.
…ce and change related course files.
…urse in course.go
…eate as well as update teacher
…ipt and integrate with import_from_jwc part
我这里修改了一遍,麻烦ddl看看这个最新的commit 还有什么问题吗 |
util/selenium-get/load2db.go
Outdated
func Lines2TrainingPlan(lines []string) LoadedTrainingPlan { | ||
plan := LoadedTrainingPlan{ | ||
Courses: make([]LoadedCourse, 0), | ||
} | ||
// e.g 13050243,14761201813050243,视觉传达设计,13050243,4,28.5,艺术学,设计学院,本科,2018 | ||
metaInfo := strings.Split(lines[0], ",") | ||
if len(metaInfo) != 10 { | ||
panic("Invalid line2trainingplan: " + lines[0]) | ||
} | ||
plan.Name = metaInfo[2] | ||
plan.Code = metaInfo[0] | ||
plan.TotalYear, _ = strconv.Atoi(metaInfo[4]) | ||
plan.MinCredits, _ = strconv.ParseFloat(metaInfo[5], 64) | ||
plan.MajorClass = metaInfo[6] | ||
plan.Department = metaInfo[7] | ||
plan.Degree = metaInfo[8] | ||
plan.EntryYear, _ = strconv.Atoi(metaInfo[9]) | ||
for _, line := range lines[1:] { | ||
plan.Courses = append(plan.Courses, Line2Course(line)) | ||
} | ||
return plan | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这种最好是加个单测,不然以后没法维护
util/selenium-get/load2db_test.go
Outdated
func TestLoadTrainingPlan2DB(t *testing.T){ | ||
LoadTrainingPlan2DB("./data/trainingPlan.txt", nil) | ||
} | ||
func TestLoadTeacherProfile2DB(t *testing.T){ | ||
LoadTeacherProfile2DB("./data/teachers.json", nil) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有单测的话,单测的数据也要放进 git 里,不然ci过不了
重新批注了,rebase main,然后跑一下 ci |
- python script optimization - refactor some structure - add more tests
我感觉我们这个分支中间节点和main上各写各的,rebase不太明白 |
ci 肯定是要在测试环节导入数据,要么你就不要这部分测试。 |
你这个 rebase 记录有点奇怪啊,我来重新操作一遍吧 |
# Conflicts: # cmd/migrate/migrate.go # handler/auth.go # repository/course.go # repository/teacher.go
那我先把CI里面的测试从仓库里转到本地, 到时候如果还需要就用github action CI的Secret存数据库密码再测试 |
CI可以通过了, 麻烦ddl看一下还有什么问题吗? |
feat: teacher and trainingplan.
done:
todo: