berkeley-cdss / seating

Exam seating assignments
https://seating-staging-74ac4c6b8c38.herokuapp.com/
Apache License 2.0
2 stars 0 forks source link

Fix: Unhandled bug when batch deleting students by emails #60

Closed Reimirno closed 8 months ago

Reimirno commented 8 months ago

This one is actually funny. We have students = Student.query.filter(Student.email.in_(emails) & Student.exam_id == exam.id) and this works fine with Sqlite3. But then for postgres you have to do students = Student.query.filter(Student.email.in_(emails) & (Student.exam_id == exam.id)). Otherwise the & get evaluated before ==.

github-actions[bot] commented 8 months ago

Coverage

Coverage for unit tests for Python 3.11
FileStmtsMissCoverMissing
server
   __init__.py44491%20–21, 60, 68
   forms.py1131587%22–24, 40–42, 67–69, 120–123, 130, 138
   models.py1674275%28, 56, 60, 63, 66, 69, 72–77, 103, 107, 110–119, 122, 125, 139, 142–144, 147, 151, 163, 167, 171, 175–176, 182, 185, 205, 208, 229, 232, 246
   views.py64154116%32, 42–78, 88–122, 133–137, 154–163, 179–196, 207–214, 223–245, 256–269, 278, 289–292, 303–322, 335–359, 368–390, 399–426, 435–444, 453–495, 504–506, 514–517, 525–550, 558–583, 591–619, 627–644, 651, 656–660, 669–671, 676–723, 729–780, 786–797, 802–822, 827–852, 857–872, 877–896, 910, 915, 923–924, 932, 937–941
server/controllers
   __init__.py572949%25–52, 55, 66–75, 78
   auth_controllers.py382534%13–15, 21–47, 53–55
   dev_login_controllers.py342332%11–25, 30–39, 44–56
   health_controllers.py13285%17–18
server/services/auth
   __init__.py29679%22, 51, 56–57, 62–63
server/services/canvas
   __init__.py806124%18–25, 29, 33, 37, 43, 55–64, 69–105, 109–124, 128
   fake_canvas.py392633%9, 12, 15, 20–25, 28–29, 37–46, 49–56
server/services/core
   assign.py372922%8, 16–17, 34–60, 73–89
   data.py473428%10–15, 19–23, 27–31, 35–37, 41–52, 56–58, 62–63, 67–68
   export.py8625%8–21
   room.py61568%11–33, 41–89
   student.py41387%9–54
server/services/csv
   __init__.py181233%11–12, 19–22, 29–34
server/services/email
   __init__.py352529%17–34, 38–65
   smtp.py391172%15, 27–29, 31–33, 49–52
server/services/email/templates
   __init__.py33197%20
server/services/google
   __init__.py542946%23, 31, 33, 41–44, 48–54, 58–77
server/typings
   exception.py321166%20–33, 39, 44, 50, 56–57, 66, 69
server/utils
   date.py7443%17–19, 30
   misc.py161319%5–9, 13–19, 23
TOTAL1708104339% 

Tests Skipped Failures Errors Time
16 0 :zzz: 0 :x: 0 :fire: 0.758s :stopwatch:
github-actions[bot] commented 8 months ago

Coverage

Coverage for unit tests for Python 3.10
FileStmtsMissCoverMissing
server
   __init__.py44491%20–21, 60, 68
   forms.py1131587%22–24, 40–42, 67–69, 120–123, 130, 138
   models.py1674275%28, 56, 60, 63, 66, 69, 72–77, 103, 107, 110–119, 122, 125, 139, 142–144, 147, 151, 163, 167, 171, 175–176, 182, 185, 205, 208, 229, 232, 246
   views.py64154116%32, 42–78, 88–122, 133–137, 154–163, 179–196, 207–214, 223–245, 256–269, 278, 289–292, 303–322, 335–359, 368–390, 399–426, 435–444, 453–495, 504–506, 514–517, 525–550, 558–583, 591–619, 627–644, 651, 656–660, 669–671, 676–723, 729–780, 786–797, 802–822, 827–852, 857–872, 877–896, 910, 915, 923–924, 932, 937–941
server/controllers
   __init__.py572949%25–52, 55, 66–75, 78
   auth_controllers.py382534%13–15, 21–47, 53–55
   dev_login_controllers.py342332%11–25, 30–39, 44–56
   health_controllers.py13285%17–18
server/services/auth
   __init__.py29679%22, 51, 56–57, 62–63
server/services/canvas
   __init__.py806124%18–25, 29, 33, 37, 43, 55–64, 69–105, 109–124, 128
   fake_canvas.py392633%9, 12, 15, 20–25, 28–29, 37–46, 49–56
server/services/core
   assign.py372922%8, 16–17, 34–60, 73–89
   data.py473428%10–15, 19–23, 27–31, 35–37, 41–52, 56–58, 62–63, 67–68
   export.py8625%8–21
   room.py61568%11–33, 41–89
   student.py41387%9–54
server/services/csv
   __init__.py181233%11–12, 19–22, 29–34
server/services/email
   __init__.py352529%17–34, 38–65
   smtp.py391172%15, 27–29, 31–33, 49–52
server/services/email/templates
   __init__.py33197%20
server/services/google
   __init__.py542946%23, 31, 33, 41–44, 48–54, 58–77
server/typings
   exception.py321166%20–33, 39, 44, 50, 56–57, 66, 69
server/utils
   date.py7443%17–19, 30
   misc.py161319%5–9, 13–19, 23
TOTAL1708104339% 

Tests Skipped Failures Errors Time
16 0 :zzz: 0 :x: 0 :fire: 5.769s :stopwatch:
github-actions[bot] commented 8 months ago

Coverage

Coverage for unit tests for Python 3.12
FileStmtsMissCoverMissing
server
   __init__.py44491%20–21, 60, 68
   forms.py1131587%22–24, 40–42, 67–69, 120–123, 130, 138
   models.py1674275%28, 56, 60, 63, 66, 69, 72–77, 103, 107, 110–119, 122, 125, 139, 142–144, 147, 151, 163, 167, 171, 175–176, 182, 185, 205, 208, 229, 232, 246
   views.py64154116%32, 42–78, 88–122, 133–137, 154–163, 179–196, 207–214, 223–245, 256–269, 278, 289–292, 303–322, 335–359, 368–390, 399–426, 435–444, 453–495, 504–506, 514–517, 525–550, 558–583, 591–619, 627–644, 651, 656–660, 669–671, 676–723, 729–780, 786–797, 802–822, 827–852, 857–872, 877–896, 910, 915, 923–924, 932, 937–941
server/controllers
   __init__.py572949%25–52, 55, 66–75, 78
   auth_controllers.py382534%13–15, 21–47, 53–55
   dev_login_controllers.py342332%11–25, 30–39, 44–56
   health_controllers.py13285%17–18
server/services/auth
   __init__.py29679%22, 51, 56–57, 62–63
server/services/canvas
   __init__.py806124%18–25, 29, 33, 37, 43, 55–64, 69–105, 109–124, 128
   fake_canvas.py392633%9, 12, 15, 20–25, 28–29, 37–46, 49–56
server/services/core
   assign.py372922%8, 16–17, 34–60, 73–89
   data.py473428%10–15, 19–23, 27–31, 35–37, 41–52, 56–58, 62–63, 67–68
   export.py8625%8–21
   room.py61568%11–33, 41–89
   student.py41387%9–54
server/services/csv
   __init__.py181233%11–12, 19–22, 29–34
server/services/email
   __init__.py352529%17–34, 38–65
   smtp.py391172%15, 27–29, 31–33, 49–52
server/services/email/templates
   __init__.py33197%20
server/services/google
   __init__.py542946%23, 31, 33, 41–44, 48–54, 58–77
server/typings
   exception.py321166%20–33, 39, 44, 50, 56–57, 66, 69
server/utils
   date.py7443%17–19, 30
   misc.py161319%5–9, 13–19, 23
TOTAL1708104339% 

Tests Skipped Failures Errors Time
16 0 :zzz: 0 :x: 0 :fire: 0.810s :stopwatch:
github-actions[bot] commented 8 months ago

Coverage

Coverage for e2e tests for Python 3.10
FileStmtsMissCoverMissing
server
   __init__.py441077%12, 15–21, 26, 60, 68
   forms.py1131587%22–24, 40–42, 67–69, 120–123, 130, 138
   models.py1674474%27–30, 56, 60, 63, 66, 69, 72–77, 103, 107, 110–119, 122, 125, 139, 142–144, 147, 151, 163, 167, 171, 175–176, 182, 185, 205, 208, 229, 232, 246
   views.py64154415%31–33, 42–78, 88–122, 133–137, 154–163, 179–196, 207–214, 223–245, 256–269, 278, 289–292, 303–322, 335–359, 368–390, 399–426, 435–444, 453–495, 504–506, 514–517, 525–550, 558–583, 591–619, 627–644, 651, 656–660, 669–671, 676–723, 729–780, 786–797, 802–822, 827–852, 857–872, 877–896, 905, 910, 915, 923–924, 932, 937–941
server/controllers
   __init__.py572949%25–52, 55, 66–75, 78
   auth_controllers.py382534%13–15, 21–47, 53–55
   dev_login_controllers.py342332%11–25, 30–39, 44–56
   health_controllers.py13746%8, 13–18
server/services/auth
   __init__.py29679%22, 51, 56–57, 62–63
server/services/canvas
   __init__.py806124%18–25, 29, 33, 37, 43, 55–64, 69–105, 109–124, 128
   fake_canvas.py392633%9, 12, 15, 20–25, 28–29, 37–46, 49–56
server/services/core
   assign.py372922%8, 16–17, 34–60, 73–89
   data.py473428%10–15, 19–23, 27–31, 35–37, 41–52, 56–58, 62–63, 67–68
   export.py8625%8–21
   room.py61568%11–33, 41–89
   student.py41387%9–54
server/services/csv
   __init__.py181233%11–12, 19–22, 29–34
server/services/email
   __init__.py352529%17–34, 38–65
   smtp.py392731%15, 24–52
server/services/email/templates
   __init__.py332330%9–11, 14–17, 20, 30–41, 45–47
server/services/google
   __init__.py542946%23, 31, 33, 41–44, 48–54, 58–77
server/typings
   exception.py321166%20–33, 39, 44, 50, 56–57, 66, 69
server/utils
   date.py7443%17–19, 30
   misc.py161319%5–9, 13–19, 23
TOTAL1708109736% 

Tests Skipped Failures Errors Time
8 0 :zzz: 0 :x: 0 :fire: 24.907s :stopwatch:
github-actions[bot] commented 8 months ago

Coverage

Coverage for e2e tests for Python 3.11
FileStmtsMissCoverMissing
server
   __init__.py441077%12, 15–21, 26, 60, 68
   forms.py1131587%22–24, 40–42, 67–69, 120–123, 130, 138
   models.py1674474%27–30, 56, 60, 63, 66, 69, 72–77, 103, 107, 110–119, 122, 125, 139, 142–144, 147, 151, 163, 167, 171, 175–176, 182, 185, 205, 208, 229, 232, 246
   views.py64154415%31–33, 42–78, 88–122, 133–137, 154–163, 179–196, 207–214, 223–245, 256–269, 278, 289–292, 303–322, 335–359, 368–390, 399–426, 435–444, 453–495, 504–506, 514–517, 525–550, 558–583, 591–619, 627–644, 651, 656–660, 669–671, 676–723, 729–780, 786–797, 802–822, 827–852, 857–872, 877–896, 905, 910, 915, 923–924, 932, 937–941
server/controllers
   __init__.py572949%25–52, 55, 66–75, 78
   auth_controllers.py382534%13–15, 21–47, 53–55
   dev_login_controllers.py342332%11–25, 30–39, 44–56
   health_controllers.py13746%8, 13–18
server/services/auth
   __init__.py29679%22, 51, 56–57, 62–63
server/services/canvas
   __init__.py806124%18–25, 29, 33, 37, 43, 55–64, 69–105, 109–124, 128
   fake_canvas.py392633%9, 12, 15, 20–25, 28–29, 37–46, 49–56
server/services/core
   assign.py372922%8, 16–17, 34–60, 73–89
   data.py473428%10–15, 19–23, 27–31, 35–37, 41–52, 56–58, 62–63, 67–68
   export.py8625%8–21
   room.py61568%11–33, 41–89
   student.py41387%9–54
server/services/csv
   __init__.py181233%11–12, 19–22, 29–34
server/services/email
   __init__.py352529%17–34, 38–65
   smtp.py392731%15, 24–52
server/services/email/templates
   __init__.py332330%9–11, 14–17, 20, 30–41, 45–47
server/services/google
   __init__.py542946%23, 31, 33, 41–44, 48–54, 58–77
server/typings
   exception.py321166%20–33, 39, 44, 50, 56–57, 66, 69
server/utils
   date.py7443%17–19, 30
   misc.py161319%5–9, 13–19, 23
TOTAL1708109736% 

Tests Skipped Failures Errors Time
8 0 :zzz: 0 :x: 0 :fire: 31.898s :stopwatch:
github-actions[bot] commented 8 months ago

Coverage

Coverage for e2e tests for Python 3.12
FileStmtsMissCoverMissing
server
   __init__.py441077%12, 15–21, 26, 60, 68
   forms.py1131587%22–24, 40–42, 67–69, 120–123, 130, 138
   models.py1674474%27–30, 56, 60, 63, 66, 69, 72–77, 103, 107, 110–119, 122, 125, 139, 142–144, 147, 151, 163, 167, 171, 175–176, 182, 185, 205, 208, 229, 232, 246
   views.py64154415%31–33, 42–78, 88–122, 133–137, 154–163, 179–196, 207–214, 223–245, 256–269, 278, 289–292, 303–322, 335–359, 368–390, 399–426, 435–444, 453–495, 504–506, 514–517, 525–550, 558–583, 591–619, 627–644, 651, 656–660, 669–671, 676–723, 729–780, 786–797, 802–822, 827–852, 857–872, 877–896, 905, 910, 915, 923–924, 932, 937–941
server/controllers
   __init__.py572949%25–52, 55, 66–75, 78
   auth_controllers.py382534%13–15, 21–47, 53–55
   dev_login_controllers.py342332%11–25, 30–39, 44–56
   health_controllers.py13746%8, 13–18
server/services/auth
   __init__.py29679%22, 51, 56–57, 62–63
server/services/canvas
   __init__.py806124%18–25, 29, 33, 37, 43, 55–64, 69–105, 109–124, 128
   fake_canvas.py392633%9, 12, 15, 20–25, 28–29, 37–46, 49–56
server/services/core
   assign.py372922%8, 16–17, 34–60, 73–89
   data.py473428%10–15, 19–23, 27–31, 35–37, 41–52, 56–58, 62–63, 67–68
   export.py8625%8–21
   room.py61568%11–33, 41–89
   student.py41387%9–54
server/services/csv
   __init__.py181233%11–12, 19–22, 29–34
server/services/email
   __init__.py352529%17–34, 38–65
   smtp.py392731%15, 24–52
server/services/email/templates
   __init__.py332330%9–11, 14–17, 20, 30–41, 45–47
server/services/google
   __init__.py542946%23, 31, 33, 41–44, 48–54, 58–77
server/typings
   exception.py321166%20–33, 39, 44, 50, 56–57, 66, 69
server/utils
   date.py7443%17–19, 30
   misc.py161319%5–9, 13–19, 23
TOTAL1708109736% 

Tests Skipped Failures Errors Time
8 0 :zzz: 0 :x: 0 :fire: 38.711s :stopwatch: