Skip to content

Commit

Permalink
refactored Watcher and TravisStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
leon.schiller committed Jul 11, 2019
1 parent 1358c48 commit b8176e0
Show file tree
Hide file tree
Showing 68 changed files with 142 additions and 153 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
converting
asStringOrText
^ (self name , ' (' , self pausedStatus contents , ', ' , self status contents , ')')
^ (self name , ' (' , self pausedString , ', ' , self statusMessage , ')')
asText addAttribute: (TextColor color: (self statusColor))

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
accessing
handleStatusChange
| newStatus |
newStatus := self repository buildStatus.
(self status ~= newStatus
and: [newStatus = #failed
or: [newStatus = #errored]
or: [newStatus = #canceled]
or: [newStatus = #passed]])
ifTrue: [ATDDSoundPlayer instance playSoundForStatus: newStatus].
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
accessing
startNewRefreshProcess
newRefreshProcess
^ [[true] whileTrue: [
(Delay forSeconds: self refreshInterval) wait.
self refresh.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
behaviour
pause
self process ifNotNil: [
self process terminate.
self process: nil.
].
self terminateProcess.
super pause.
self updateStatus

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
behaviour
resume
self process
ifNil: [self process: self startNewRefreshProcess].
ifNil: [self process: self newRefreshProcess].
super resume.
self updateStatus.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
accessing
status
^ status ifNil: [status := ValueHolder new contents: self repository status]
^ status ifNil: [status := #unknown]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
accessing
statusColor
^ self class colorDictionary at: self buildStatus
^ self class colorDictionary at: self status
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
statusMessage: anObject
statusMessage := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
statusMessage
^ statusMessage ifNil: [statusMessage := 'not available']
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ updateStatus
self flag: #todo.
"Dont call changed here, solve it as solved for watchers using value
holders"
(self buildStatus ~= self repository buildStatus
and: [self buildStatus = #failed
or: [self buildStatus = #errored]
or: [self buildStatus = #canceled]
or: [self buildStatus = #passed]])
ifTrue: [ATDDSoundPlayer instance playSoundForStatus: self buildStatus].
self pausedStatus: self pausedString;
status: self repository status;
notify.

self
handleStatusChange;
status: self repository buildStatus;
statusMessage: self repository statusMessage;
notify.
ATDDBrowser changed: #travisStatuses
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
"colorDictionary" : "be 7/4/2019 17:35" },
"instance" : {
"applyDefaultConfiguration" : "vxr 7/4/2019 19:01",
"asStringOrText" : "vxr 7/4/2019 14:19",
"buildStatus" : "vxr 7/3/2019 17:07",
"asStringOrText" : "ls 7/11/2019 17:41",
"handleStatusChange" : "ls 7/11/2019 17:44",
"initialize" : "vxr 7/4/2019 19:03",
"pause" : "vxr 7/4/2019 18:55",
"pausedStatus" : "vxr 7/4/2019 14:06",
"pausedStatus:" : "vxr 7/4/2019 14:06",
"newRefreshProcess" : "ls 7/11/2019 17:52",
"pause" : "ls 7/11/2019 17:52",
"pausedString" : "ls 6/5/2019 20:42",
"process" : "ls 6/5/2019 14:42",
"process:" : "ls 6/5/2019 14:42",
Expand All @@ -19,14 +18,15 @@
"repository:" : "ls 6/5/2019 13:31",
"repositoryURL" : "ls 6/5/2019 20:20",
"repositoryURL:" : "ls 6/5/2019 20:19",
"resume" : "vxr 7/4/2019 18:55",
"startNewRefreshProcess" : "be 7/10/2019 15:04",
"status" : "vxr 7/4/2019 14:18",
"resume" : "ls 7/11/2019 17:52",
"status" : "ls 7/11/2019 17:40",
"status:" : "vxr 7/4/2019 14:19",
"statusColor" : "vxr 7/4/2019 11:40",
"statusColor" : "ls 7/11/2019 17:53",
"statusMessage" : "ls 7/11/2019 17:36",
"statusMessage:" : "ls 7/11/2019 17:36",
"terminateProcess" : "ls 6/5/2019 15:01",
"token" : "ls 6/5/2019 20:22",
"token:" : "ls 6/5/2019 14:50",
"updateStatus" : "be 7/10/2019 15:12",
"updateStatus" : "ls 7/11/2019 18:12",
"usePro" : "ls 6/5/2019 20:27",
"usePro:" : "ls 7/3/2019 16:15" } }
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"commentStamp" : "",
"instvars" : [
"repository",
"pausedStatus",
"status",
"statusMessage",
"process",
"refreshInterval" ],
"name" : "ATDDTravisStatus",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
accessing
CITestRunner: anObject
CITestRunner := anObject
ciTestRunner: anObject
ciTestRunner := anObject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
accessing
CITestRunner
^ CITestRunner ifNil: [ CITestRunner := ATDDNullTestRunner instance ]
ciTestRunner
^ ciTestRunner ifNil: [ciTestRunner := ATDDNullTestRunner new]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
converting
asStringOrText
^ (self name , ' (' , self watchingStatus, ', ', self localStatusBlock, ')')
^ (self name , ' (' , self watchingStatus, ', ', self localStatusMessage, ')')
asText addAttribute: (TextColor color: (self statusColor))
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
accessing
localStatus
^ localStatus
^ localStatus ifNil: [localStatus := #unexecuted]

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
behavior
localStatusMessage
^ (self localStatusMessageDictionary at: self localStatus) value
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
accessing
localStatusMessageDictionary
^ localStatusMessageDictionary ifNil: [
| summaryBlock |
summaryBlock := [self localTestRunner resultSummary].
localStatusMessageDictionary := IdentityDictionary new
at: #unexecuted put: [self class notExecutedText];
at: #executing put: [self localProgress];
at: #passed put: summaryBlock;
at: #failed put: summaryBlock;
at: #errored put: summaryBlock;
yourself]

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
behavior
run
self localTestRunner runTests
self localTestRunner runTests.
self ciTestRunner runTests

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
updating
updateLocalStatusTo: aSymbol
self flag: #todo. "how do we handle the changed calls? Without this one, the multiple Browser instances do not synchronize"
self localStatus: aSymbol.
(aSymbol = #unexecuted)
ifTrue: [self localStatusBlock: [self class notExecutedText]].
(aSymbol = #executing)
ifTrue: [self localStatusBlock: [self localProgress]].
(#(#passed #failed #errored) includes: aSymbol)
ifTrue:
[self finishedTesting.
self localStatusBlock: [self localTestRunner resultSummary]]
(#(#passed #failed #errored) includes: aSymbol) ifTrue: [self finishedTesting].
ATDDBrowser changed: #watchers
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
"colorDictionary" : "vxr 7/10/2019 15:49",
"notExecutedText" : "ls 5/30/2019 19:43" },
"instance" : {
"CITestRunner" : "ls 7/8/2019 14:13",
"CITestRunner:" : "ls 7/8/2019 14:14",
"addChangeListener" : "swi 5/16/2019 00:44",
"allTestClasses" : "swi 6/12/2019 18:56",
"applyDefaultConfiguration" : "vxr 7/4/2019 19:00",
"asStringOrText" : "vxr 7/4/2019 11:39",
"asStringOrText" : "ls 7/11/2019 18:37",
"categoriesToTest" : "swi 6/12/2019 18:23",
"categoriesToTest:" : "swi 6/12/2019 18:30",
"categoriesToWatch" : "swi 6/12/2019 18:27",
"categoriesToWatch:" : "swi 6/12/2019 18:27",
"ciTestRunner" : "ls 7/11/2019 18:23",
"ciTestRunner:" : "ls 7/11/2019 18:21",
"classesToTest" : "swi 6/12/2019 18:12",
"classesToTest:" : "swi 6/12/2019 18:09",
"classesToWatch" : "swi 6/12/2019 18:21",
Expand All @@ -27,21 +27,17 @@
"isWatchingClasswise" : "swi 6/12/2019 18:18",
"isWatchingClasswise:" : "swi 6/12/2019 18:18",
"localProgress" : "ls 5/30/2019 19:38",
"localStatus" : "be 7/10/2019 14:49",
"localStatus" : "ls 7/11/2019 18:27",
"localStatus:" : "be 7/10/2019 14:49",
"localStatusBlock" : "vxr 7/3/2019 16:33",
"localStatusBlock:" : "vxr 7/3/2019 16:33",
"localStatusMessage" : "ls 7/11/2019 18:40",
"localStatusMessageDictionary" : "ls 7/11/2019 18:39",
"localTestRunner" : "ls 5/15/2019 19:43",
"localTestRunner:" : "ls 5/15/2019 19:28",
"methodChanged:" : "vxr 7/10/2019 15:07",
"onChangeDetected" : "swi 5/23/2019 15:40",
"onTestChangeDetected" : "vxr 7/4/2019 13:44",
"run" : "vxr 7/4/2019 13:43",
"run" : "ls 7/11/2019 18:23",
"statusColor" : "be 7/10/2019 14:50",
"testClassesFromCategories" : "vxr 7/10/2019 15:00",
"travisStatus" : "ls 5/22/2019 14:39",
"travisStatus:" : "ls 5/22/2019 14:39",
"travisTestRunner" : "ls 5/15/2019 19:40",
"travisTestRunner:" : "ls 5/15/2019 19:28",
"updateLocalStatusTo:" : "vxr 7/4/2019 14:28",
"updateLocalStatusTo:" : "ls 7/11/2019 18:50",
"watchingStatus" : "vxr 5/29/2019 19:16" } }
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@
"commentStamp" : "",
"instvars" : [
"localTestRunner",
"travisTestRunner",
"ciTestRunner",
"isWatchingClasswise",
"classesToWatch",
"categoriesToWatch",
"isTestingClasswise",
"classesToTest",
"categoriesToTest",
"localStatus",
"localStatusBlock",
"travisStatus" ],
"localStatusMessageDictionary" ],
"name" : "ATDDWatcher",
"pools" : [
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
buildStatus
self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
clearCache
self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
repository: anObject
self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
statusMessage
self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
token
self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
update
self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
usePro
self subclassResponsibility
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
"class" : {
},
"instance" : {
"buildStatus" : "ls 7/11/2019 19:00",
"clearCache" : "ls 7/11/2019 19:00",
"repository" : "PS 6/22/2014 16:59",
"repository:" : "ls 7/11/2019 19:01",
"repositoryJson" : "PS 6/22/2014 16:59",
"statusMessage" : "ls 7/11/2019 19:01",
"token" : "ls 7/11/2019 19:01",
"token:" : "PS 6/22/2014 16:59",
"update" : "ls 7/11/2019 19:01",
"usePro" : "ls 7/11/2019 19:01",
"usePro:" : "PS 6/22/2014 16:59" } }

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
clearCache
^self

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
accessing
repository: anObject
Loading

0 comments on commit b8176e0

Please sign in to comment.