Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Temerity
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
William Walker
Temerity
Commits
b0dcd920
Commit
b0dcd920
authored
3 weeks ago
by
William Walker
Browse files
Options
Downloads
Patches
Plain Diff
test: check courses
parent
d5b0aa97
Branches
test/s25_duplicate_course_report
No related tags found
No related merge requests found
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
temerity/src/jvmTest/kotlin/edu/ucsc/its/temerity/test/ProdReportTests.kt
+26
-22
26 additions, 22 deletions
...Test/kotlin/edu/ucsc/its/temerity/test/ProdReportTests.kt
with
26 additions
and
22 deletions
temerity/src/jvmTest/kotlin/edu/ucsc/its/temerity/test/ProdReportTests.kt
+
26
−
22
View file @
b0dcd920
...
...
@@ -32,6 +32,7 @@ import edu.ucsc.its.temerity.model.EventType.NEW_LOG_IN
import
edu.ucsc.its.temerity.model.EventType.RECORDING_ERROR
import
edu.ucsc.its.temerity.util.currentDate
import
io.kotest.common.ExperimentalKotest
import
io.kotest.common.KotestInternal
import
io.kotest.matchers.file.shouldNotBeEmpty
import
kotlinx.coroutines.runBlocking
import
kotlinx.datetime.Clock
...
...
@@ -46,7 +47,7 @@ import kotlin.time.Duration.Companion.minutes
import
kotlin.uuid.ExperimentalUuidApi
import
kotlin.uuid.Uuid
@OptIn
(
ExperimentalUuidApi
::
class
)
@OptIn
(
ExperimentalUuidApi
::
class
,
KotestInternal
::
class
)
private
class
ProdReportTests
:
TemProdFunSpec
()
{
init
{
...
...
@@ -163,29 +164,32 @@ private class ProdReportTests : TemProdFunSpec() {
// "Mislinked" YuJa course report
// Generate Report listing all courses matching specific sis id that have the wrong term code, or are duplicates
test
(
"PlatformClient can fetch a list of courses with specific SIS ID by term and verify that the term code matches the correct one for the quarter"
)
{
runBlocking
{
val
fullCoursesList
=
testTemerity
.
getCourses
()
val
invalidGroupTerm
=
fullCoursesList
.
filter
{
it
.
sisId
.
startsWith
(
"2250"
)
}.
filter
{
it
.
courseTerm
!=
"2025 Winter Quarter"
test
(
"PlatformClient can fetch a list of courses with specific SIS ID by term and verify that the term code matches the correct one for the quarter"
)
.
config
(
timeout
=
45
.
minutes
)
{
runBlocking
{
val
fullCoursesList
=
testTemerity
.
getCourses
()
val
invalidGroupTerm
=
fullCoursesList
.
filter
{
course
->
course
.
sisId
.
startsWith
(
"2252"
)
}.
filter
{
course
->
course
.
courseTerm
!=
"2025 Spring Quarter"
}
val
nonMatchingSisId
=
fullCoursesList
.
filter
{
course
->
course
.
courseTerm
==
"2025 Spring Quarter"
}.
filter
{
course
->
!
course
.
sisId
.
startsWith
(
"2252"
)
&&
!
course
.
courseCode
.
endsWith
(
"-DRC"
)
&&
!
course
.
courseCode
.
contains
(
" "
)
}
val
duplicateSisId
=
fullCoursesList
.
filter
{
course
->
course
.
sisId
.
startsWith
(
"2252"
)
}.
groupBy
{
course
->
course
.
sisId
}.
filter
{
courseMapEntry
->
courseMapEntry
.
value
.
size
>
1
}.
values
.
flatten
()
val
problemCourses
=
invalidGroupTerm
+
nonMatchingSisId
+
duplicateSisId
println
(
"Total returned groups count: ${problemCourses.size}"
)
problemCourses
.
forEach
{
course
->
kermit
.
i
(
course
.
toString
())
}
val
df
=
problemCourses
.
toDataFrame
()
df
.
writeCSV
(
"wrong-term-duplicate-course-report-${Uuid.random()}-${currentDate()}.csv"
)
}
val
nonMatchingSisId
=
fullCoursesList
.
filter
{
it
.
courseTerm
==
"2025 Winter Quarter"
}.
filter
{
!
it
.
sisId
.
startsWith
(
"2250"
)
}
val
duplicateSisId
=
fullCoursesList
.
filter
{
it
.
sisId
.
startsWith
(
"2250"
)
}.
groupBy
{
it
.
sisId
}.
filter
{
it
.
value
.
size
>
1
}.
values
.
flatten
()
val
problemCourses
=
invalidGroupTerm
+
nonMatchingSisId
+
duplicateSisId
println
(
"Total returned groups count: ${problemCourses.size}"
)
problemCourses
.
forEach
{
kermit
.
i
(
it
.
toString
())
}
val
df
=
problemCourses
.
toDataFrame
()
df
.
writeCSV
(
"wrong-term-duplicate-course-report-${Uuid.random()}-${currentDate()}.csv"
)
}
}
test
(
"YuJaClient can fetch the whole list of groups"
)
{
runBlocking
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment