Skip to content

Handle purging empty queue #20

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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
a9f1dbc
Merge remote-tracking branch 'tesonep/master' into support_for_lifewa…
VincentBlondeau Apr 8, 2021
b944198
Merge remote-tracking branch 'tesonep/master' into support_for_lifewa…
VincentBlondeau Apr 23, 2021
61cbe1d
Merge remote-tracking branch 'tesonep/master' into support_for_lifewa…
VincentBlondeau May 19, 2021
03ac361
Merge remote-tracking branch 'origin/support_for_lifeware_changes' in…
VincentBlondeau May 20, 2021
ee62a3c
Fix baseline to remove the package that does not exists
VincentBlondeau May 21, 2021
539e2a8
Merge branch 'tesonep:master' into support_for_lifeware_changes
Jun 4, 2021
0b1ec22
Merge branch 'tesonep:master' into support_for_lifeware_changes
Jun 29, 2021
616862d
Merge branch 'tesonep:master' into support_for_lifeware_changes
Jul 8, 2021
1c0f1bb
Merge pull request #2 from rolandbernard/lifeware-runner-fixes
Jul 19, 2021
86f0c3c
Merge branch 'automatic-resend' into support_for_lifeware_changes
rolandbernard Jul 26, 2021
e2a1bf7
Added the TWMultipleTestItem to run multiple tests
rolandbernard Jul 26, 2021
98f5094
Fixed bugs in the previous commit
rolandbernard Jul 26, 2021
c592c10
Merge branch 'more-granular-test-items' into support_for_lifeware_cha…
rolandbernard Jul 26, 2021
28d741c
Merge branch 'automatic-resend' into support_for_lifeware_changes
rolandbernard Jul 29, 2021
4711b6a
Merge pull request #3 from lifeware-sa/optimized-on-update-block
Aug 24, 2021
fc7c236
Merge branch 'tesonep:master' into support_for_lifeware_changes
sonibla Oct 22, 2021
76622a8
add ifNone block
VincentBlondeau Dec 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BaselineOfTestWorkers/BaselineOfTestWorkers.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ BaselineOfTestWorkers >> baseline: spec [
package: 'TestWorkers-Worker' with: [ spec requires: #('TestWorkers-Connector') ];
package: 'TestWorkers-Client' with: [ spec requires: #('TestWorkers-Connector') ];
package: 'TestWorkers-UI' with: [ spec requires: #('TestWorkers-Client') ];
package: 'TestWorkers-Connector-Tests' with: [ spec requires: #('TestWorkers-Connector') ];

package: 'TestWorkers-Changes-Tests' with: [ spec requires: 'TestWorkers-Changes' ].

"Groups"
Expand Down
42 changes: 30 additions & 12 deletions src/TestWorkers-Client/TWClient.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ TWClient >> processName [

{ #category : #operations }
TWClient >> purgePendingMessages [

(self queueNamed: 'testRequest') purge
(self queueNamed: 'testRequest' ifNone: [^self]) purge
]

{ #category : #accessing }
Expand Down Expand Up @@ -122,6 +121,31 @@ TWClient >> resetResults [

]

{ #category : #running }
TWClient >> runMultipleTest: aMultipleTest [

| request |

request := TWMultipleTestRequest new
tests: aMultipleTest tests;
yourself.

self runRequest: request


]

{ #category : #running }
TWClient >> runRequest: aTWTestRequest [

requests at: aTWTestRequest uuid asString put: aTWTestRequest.

"RabbitMQ likes to close the connection. This ensures we retry until we are able to connect again."
self ensureNetworkSuccess: [ aTWTestRequest sendOn: connection ]


]

{ #category : #running }
TWClient >> runSingleTest: aSingleTest [

Expand All @@ -132,27 +156,21 @@ TWClient >> runSingleTest: aSingleTest [
testSelector: aSingleTest testSelector;
yourself.

requests at: request uuid asString put: request.

"RabbitMQ likes to close the connection. This ensures we retry until we are able to connect again."
self ensureNetworkSuccess: [ request sendOn: connection ]
self runRequest: request


]

{ #category : #operations }
{ #category : #running }
TWClient >> runTestClass: aTestCase [

| request |

request := TWTestRequest new
request := TWClassTestRequest new
testClassName: aTestCase name;
yourself.

requests at: request uuid asString put: request.

"RabbitMQ likes to close the connection. This ensures we retry until we are able to connect again."
self ensureNetworkSuccess: [ request sendOn: connection ]
self runRequest: request


]
Expand Down
3 changes: 1 addition & 2 deletions src/TestWorkers-Connector/TWAbstractConnected.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ TWAbstractConnected >> processRequest [

{ #category : #configuration }
TWAbstractConnected >> queueNamed: aName [

^ self rqServer queues detect: [ :e | e name = aName ].
^self queueNamed: aName ifNone: [self error: 'The queue doesn''t exixts!']
]

{ #category : #configuration }
Expand Down
18 changes: 18 additions & 0 deletions src/TestWorkers-Connector/TWClassTestRequest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Class {
#name : #TWClassTestRequest,
#superclass : #TWTestRequest,
#instVars : [
'testClassName'
],
#category : #'TestWorkers-Connector'
}

{ #category : #accessing }
TWClassTestRequest >> testClassName [
^ testClassName
]

{ #category : #accessing }
TWClassTestRequest >> testClassName: anObject [
testClassName := anObject
]
20 changes: 20 additions & 0 deletions src/TestWorkers-Connector/TWMultipleTestRequest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Class {
#name : #TWMultipleTestRequest,
#superclass : #TWTestRequest,
#instVars : [
'tests'
],
#category : #'TestWorkers-Connector'
}

{ #category : #accessing }
TWMultipleTestRequest >> tests [

^ tests
]

{ #category : #accessing }
TWMultipleTestRequest >> tests: aCollection [

tests := aCollection
]
13 changes: 1 addition & 12 deletions src/TestWorkers-Connector/TWSingleTestRequest.class.st
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
Class {
#name : #TWSingleTestRequest,
#superclass : #TWTestRequest,
#superclass : #TWClassTestRequest,
#instVars : [
'testSelector'
],
#category : #'TestWorkers-Connector'
}

{ #category : #testing }
TWSingleTestRequest >> executionResponseFor: testResults [

^ TWSingleTestResponse new
testResults: testResults;
testClassName: self testClassName;
testSelector: self testSelector;
uuid: self uuid;
yourself
]

{ #category : #accessing }
TWSingleTestRequest >> testSelector [

Expand Down
20 changes: 0 additions & 20 deletions src/TestWorkers-Connector/TWSingleTestResponse.class.st

This file was deleted.

12 changes: 6 additions & 6 deletions src/TestWorkers-Connector/TWTestExecutionError.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Class {
#name : #TWTestExecutionError,
#superclass : #TWMessage,
#instVars : [
'testClassName',
'exceptionMessage',
'serializedException'
'serializedException',
'testRequest'
],
#category : #'TestWorkers-Connector'
}
Expand Down Expand Up @@ -49,11 +49,11 @@ TWTestExecutionError >> serializedException: anObject [
]

{ #category : #accessing }
TWTestExecutionError >> testClassName [
^ testClassName
TWTestExecutionError >> testRequest [
^ testRequest
]

{ #category : #accessing }
TWTestExecutionError >> testClassName: anObject [
testClassName := anObject
TWTestExecutionError >> testRequest: anObject [
testRequest := anObject
]
21 changes: 1 addition & 20 deletions src/TestWorkers-Connector/TWTestRequest.class.st
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
Class {
#name : #TWTestRequest,
#superclass : #TWMessage,
#instVars : [
'testClassName'
],
#category : #'TestWorkers-Connector'
}

{ #category : #testing }
TWTestRequest >> buildSuite [

^ (self class environment classNamed: testClassName) buildSuite
]

{ #category : #converting }
TWTestRequest >> execute: client [

Expand All @@ -24,7 +15,7 @@ TWTestRequest >> executionResponseFor: testResults [

^ TWTestResponse new
testResults: testResults;
testClassName: self testClassName;
testRequest: self;
uuid: self uuid;
yourself
]
Expand All @@ -41,13 +32,3 @@ TWTestRequest >> queueName [
^ 'testRequest'

]

{ #category : #accessing }
TWTestRequest >> testClassName [
^ testClassName
]

{ #category : #accessing }
TWTestRequest >> testClassName: anObject [
testClassName := anObject
]
12 changes: 6 additions & 6 deletions src/TestWorkers-Connector/TWTestResponse.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Class {
#superclass : #TWMessage,
#instVars : [
'testResults',
'testClassName'
'testRequest'
],
#category : #'TestWorkers-Connector'
}
Expand All @@ -18,7 +18,7 @@ TWTestResponse >> execute: client [
TWTestResponse >> handleSendError: anError on: connection [

TWTestExecutionError new
testClassName: testClassName;
testRequest: testRequest;
exceptionMessage: anError class name printString , anError messageText printString;
serializedException: (self tryToSerialize: anError);
uuid: self uuid;
Expand All @@ -34,13 +34,13 @@ TWTestResponse >> queueName [
]

{ #category : #accessing }
TWTestResponse >> testClassName [
^ testClassName
TWTestResponse >> testRequest [
^ testRequest
]

{ #category : #accessing }
TWTestResponse >> testClassName: anObject [
testClassName := anObject
TWTestResponse >> testRequest: anObject [
testRequest := anObject
]

{ #category : #accessing }
Expand Down
18 changes: 18 additions & 0 deletions src/TestWorkers-UI/TWClassTestRequest.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Extension { #name : #TWClassTestRequest }

{ #category : #'*TestWorkers-UI' }
TWClassTestRequest >> buildSuite [

^ (self class environment classNamed: testClassName) buildSuite
]

{ #category : #'*TestWorkers-UI' }
TWClassTestRequest >> drTestsBrowse [
(self class environment at: testClassName) browse
]

{ #category : #'*TestWorkers-UI' }
TWClassTestRequest >> drTestsName [

^ testClassName asString
]
44 changes: 44 additions & 0 deletions src/TestWorkers-UI/TWMultipleTestItem.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Class {
#name : #TWMultipleTestItem,
#superclass : #Object,
#instVars : [
'testClass',
'testSelector',
'tests'
],
#category : #'TestWorkers-UI'
}

{ #category : #actions }
TWMultipleTestItem >> drTestsBrowse [
]

{ #category : #actions }
TWMultipleTestItem >> isAbstract [

^ false
]

{ #category : #actions }
TWMultipleTestItem >> name [

^ ', ' join: (tests collect: [ :test | test key , ' >> ' , test value ])
]

{ #category : #actions }
TWMultipleTestItem >> runTestInClient: client [

^ client runMultipleTest: self
]

{ #category : #actions }
TWMultipleTestItem >> tests [

^ tests
]

{ #category : #actions }
TWMultipleTestItem >> tests: aCollection [

tests := aCollection
]
24 changes: 24 additions & 0 deletions src/TestWorkers-UI/TWMultipleTestRequest.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Extension { #name : #TWMultipleTestRequest }

{ #category : #'*TestWorkers-UI' }
TWMultipleTestRequest >> buildSuite [

| suite |

suite := TestSuite new.
tests do: [ :test |
suite addTest: ((self class environment classNamed: test key) selector: test value).
].

^ suite.
]

{ #category : #'*TestWorkers-UI' }
TWMultipleTestRequest >> drTestsBrowse [
]

{ #category : #'*TestWorkers-UI' }
TWMultipleTestRequest >> drTestsName [

^ ', ' join: (tests collect: [ :test | test key asString , ' >> ' , test value asString ])
]
4 changes: 2 additions & 2 deletions src/TestWorkers-UI/TWTestExecutionError.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ Extension { #name : #TWTestExecutionError }
{ #category : #'*TestWorkers-UI' }
TWTestExecutionError >> drTestsBrowse [

(self class environment at: testClassName) browse
testRequest drTestsBrowse
]

{ #category : #'*TestWorkers-UI' }
TWTestExecutionError >> drTestsName [

^ testClassName , ' - ' , exceptionMessage
^ testRequest drTestsName , ' - ' , exceptionMessage
]
Loading