The Trunk: SUnit-mt.117.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: SUnit-mt.117.mcz

commits-2
Marcel Taeumel uploaded a new version of SUnit to project The Trunk:
http://source.squeak.org/trunk/SUnit-mt.117.mcz

==================== Summary ====================

Name: SUnit-mt.117
Author: mt
Time: 4 September 2019, 5:27:53.689072 pm
UUID: ca737f98-f12d-48c1-bb86-028b96fe0cf4
Ancestors: SUnit-mt.116

Measure the time to run a test and store it into the test-case history.

=============== Diff against SUnit-mt.116 ===============

Item was changed:
  ----- Method: TestCase>>run: (in category 'running') -----
  run: aResult
+ aResult runCaseMeasured: self.
- aResult runCase: self.
  !

Item was changed:
  Object subclass: #TestResult
+ instanceVariableNames: 'timeStamp failures errors passed durations'
- instanceVariableNames: 'timeStamp failures errors passed'
  classVariableNames: ''
  poolDictionaries: ''
  category: 'SUnit-Kernel'!
 
  !TestResult commentStamp: '<historical>' prior: 0!
  This is a Collecting Parameter for the running of a bunch of tests. TestResult is an interesting object to subclass or substitute. #runCase: is the external protocol you need to reproduce. Kent has seen TestResults that recorded coverage information and that sent email when they were done.!

Item was added:
+ ----- Method: TestResult>>duration (in category 'accessing') -----
+ duration
+
+ ^ self durations inject: 0 into: [:sum :each | sum + each]!

Item was added:
+ ----- Method: TestResult>>durations (in category 'accessing') -----
+ durations
+ ^ durations!

Item was changed:
  ----- Method: TestResult>>initialize (in category 'initialization') -----
  initialize
  super initialize.
  passed := OrderedCollection new.
  failures := Set new.
  errors := OrderedCollection new.
+ timeStamp := TimeStamp now.
+ durations := Dictionary new.!
- timeStamp := TimeStamp now!

Item was changed:
  ----- Method: TestResult>>printOn: (in category 'printing') -----
  printOn: aStream
  aStream
  nextPutAll: self runCount printString;
+ nextPutAll: ' run in ';
+ nextPutAll: (Duration milliSeconds: self duration) printString;
+ nextPutAll: ', ';
- nextPutAll: ' run, ';
  nextPutAll: self expectedPassCount printString;
  nextPutAll: ' passes, ';
  nextPutAll: self expectedDefectCount printString;
  nextPutAll:' expected failures, ';
  nextPutAll: self unexpectedFailureCount printString;
  nextPutAll: ' failures, ';
  nextPutAll: self unexpectedErrorCount printString;
  nextPutAll:' errors, ';
  nextPutAll: self unexpectedPassCount printString;
  nextPutAll:' unexpected passes'.!

Item was added:
+ ----- Method: TestResult>>runCaseMeasured: (in category 'running') -----
+ runCaseMeasured: aTestCase
+
+ self durations
+ at: aTestCase
+ put: [self runCase: aTestCase] timeToRunWithoutGC.!

Item was changed:
  ----- Method: TestResult>>selectResultsForTestCase: (in category 'history') -----
  selectResultsForTestCase: aTestCaseClass
+ | passedSelectors errorsSelectors failuresSelectors testCaseDurations |
+
- | passedSelectors errorsSelectors failuresSelectors |
  passedSelectors := self passed
  select: [:testCase | testCase class == aTestCaseClass ] thenCollect: [:testCase | testCase selector].
  errorsSelectors := self errors
  select: [:testCase | testCase class == aTestCaseClass ] thenCollect:  [:testCase | testCase selector].
  failuresSelectors := self failures
  select: [:testCase | testCase class == aTestCaseClass ] thenCollect:  [:testCase | testCase selector].
+
+ testCaseDurations := Dictionary new.
+ self durations keysAndValuesDo: [:testCase :milliseconds |
+ testCase class == aTestCaseClass ifTrue: [testCaseDurations at: testCase selector put: milliseconds]].
+
+ ^ self class newTestDictionary
+ at: #timeStamp put: self timeStamp; "Keep this result's time stamp."
-
- ^ self class newTestDictionary
  at: #passed put: passedSelectors asSet;
  at: #failures put: failuresSelectors asSet;
  at: #errors put: errorsSelectors asSet;
+ at: #durations put: testCaseDurations;
+ at: #duration put: (testCaseDurations inject: 0 into: [:sum :each | sum + each]);
  yourself
  !


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: SUnit-mt.117.mcz

Chris Muller-3
Hey Marcel, I think we're trying to get to a place where we can deprecate TimeStamp.  Would you mind using DateAndTime instead?

Best,
  Chris

On Wed, Sep 4, 2019 at 10:27 AM <[hidden email]> wrote:
Marcel Taeumel uploaded a new version of SUnit to project The Trunk:
http://source.squeak.org/trunk/SUnit-mt.117.mcz

==================== Summary ====================

Name: SUnit-mt.117
Author: mt
Time: 4 September 2019, 5:27:53.689072 pm
UUID: ca737f98-f12d-48c1-bb86-028b96fe0cf4
Ancestors: SUnit-mt.116

Measure the time to run a test and store it into the test-case history.

=============== Diff against SUnit-mt.116 ===============

Item was changed:
  ----- Method: TestCase>>run: (in category 'running') -----
  run: aResult
+       aResult runCaseMeasured: self.
-       aResult runCase: self.
  !

Item was changed:
  Object subclass: #TestResult
+       instanceVariableNames: 'timeStamp failures errors passed durations'
-       instanceVariableNames: 'timeStamp failures errors passed'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'SUnit-Kernel'!

  !TestResult commentStamp: '<historical>' prior: 0!
  This is a Collecting Parameter for the running of a bunch of tests. TestResult is an interesting object to subclass or substitute. #runCase: is the external protocol you need to reproduce. Kent has seen TestResults that recorded coverage information and that sent email when they were done.!

Item was added:
+ ----- Method: TestResult>>duration (in category 'accessing') -----
+ duration
+
+       ^ self durations inject: 0 into: [:sum :each | sum + each]!

Item was added:
+ ----- Method: TestResult>>durations (in category 'accessing') -----
+ durations
+       ^ durations!

Item was changed:
  ----- Method: TestResult>>initialize (in category 'initialization') -----
  initialize
        super initialize.
        passed := OrderedCollection new.
        failures := Set new.
        errors := OrderedCollection new.
+       timeStamp := TimeStamp now.
+       durations := Dictionary new.!
-       timeStamp := TimeStamp now!

Item was changed:
  ----- Method: TestResult>>printOn: (in category 'printing') -----
  printOn: aStream
        aStream
                nextPutAll: self runCount printString;
+               nextPutAll: ' run in ';
+               nextPutAll: (Duration milliSeconds: self duration) printString;
+               nextPutAll: ', ';
-               nextPutAll: ' run, ';
                nextPutAll: self expectedPassCount printString;
                nextPutAll: ' passes, ';
                nextPutAll: self expectedDefectCount printString;
                nextPutAll:' expected failures, ';
                nextPutAll: self unexpectedFailureCount printString;
                nextPutAll: ' failures, ';
                nextPutAll: self unexpectedErrorCount printString;
                nextPutAll:' errors, ';
                nextPutAll: self unexpectedPassCount printString;
                nextPutAll:' unexpected passes'.!

Item was added:
+ ----- Method: TestResult>>runCaseMeasured: (in category 'running') -----
+ runCaseMeasured: aTestCase
+
+       self durations
+               at: aTestCase
+               put: [self runCase: aTestCase] timeToRunWithoutGC.!

Item was changed:
  ----- Method: TestResult>>selectResultsForTestCase: (in category 'history') -----
  selectResultsForTestCase: aTestCaseClass
+       | passedSelectors errorsSelectors failuresSelectors testCaseDurations |
+       
-       | passedSelectors errorsSelectors failuresSelectors |
        passedSelectors := self passed
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect: [:testCase | testCase selector].
        errorsSelectors := self errors
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect:  [:testCase | testCase selector].
        failuresSelectors := self failures
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect:  [:testCase | testCase selector].
+
+       testCaseDurations := Dictionary new.
+       self durations keysAndValuesDo: [:testCase :milliseconds |
+               testCase class == aTestCaseClass ifTrue: [testCaseDurations at: testCase selector put: milliseconds]].         
+
+       ^ self class newTestDictionary
+               at: #timeStamp put: self timeStamp; "Keep this result's time stamp."
-       
-       ^ self class newTestDictionary
                at: #passed put: passedSelectors asSet;
                at: #failures put: failuresSelectors asSet;
                at: #errors put: errorsSelectors asSet;
+               at: #durations put: testCaseDurations;
+               at: #duration put: (testCaseDurations inject: 0 into: [:sum :each | sum + each]);
                yourself
                !




Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: SUnit-mt.117.mcz

marcel.taeumel
Hi Chris,

sure. I didn't touch that part yet, but I can clean that up in SUnit. :-) For the measurements, I use plain milliseconds and Duration.

Best,
Marcel

Am 05.09.2019 22:17:40 schrieb Chris Muller <[hidden email]>:

Hey Marcel, I think we're trying to get to a place where we can deprecate TimeStamp.  Would you mind using DateAndTime instead?

Best,
  Chris

On Wed, Sep 4, 2019 at 10:27 AM <[hidden email]> wrote:
Marcel Taeumel uploaded a new version of SUnit to project The Trunk:
http://source.squeak.org/trunk/SUnit-mt.117.mcz

==================== Summary ====================

Name: SUnit-mt.117
Author: mt
Time: 4 September 2019, 5:27:53.689072 pm
UUID: ca737f98-f12d-48c1-bb86-028b96fe0cf4
Ancestors: SUnit-mt.116

Measure the time to run a test and store it into the test-case history.

=============== Diff against SUnit-mt.116 ===============

Item was changed:
  ----- Method: TestCase>>run: (in category 'running') -----
  run: aResult
+       aResult runCaseMeasured: self.
-       aResult runCase: self.
  !

Item was changed:
  Object subclass: #TestResult
+       instanceVariableNames: 'timeStamp failures errors passed durations'
-       instanceVariableNames: 'timeStamp failures errors passed'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'SUnit-Kernel'!

  !TestResult commentStamp: '<historical>' prior: 0!
  This is a Collecting Parameter for the running of a bunch of tests. TestResult is an interesting object to subclass or substitute. #runCase: is the external protocol you need to reproduce. Kent has seen TestResults that recorded coverage information and that sent email when they were done.!

Item was added:
+ ----- Method: TestResult>>duration (in category 'accessing') -----
+ duration
+
+       ^ self durations inject: 0 into: [:sum :each | sum + each]!

Item was added:
+ ----- Method: TestResult>>durations (in category 'accessing') -----
+ durations
+       ^ durations!

Item was changed:
  ----- Method: TestResult>>initialize (in category 'initialization') -----
  initialize
        super initialize.
        passed := OrderedCollection new.
        failures := Set new.
        errors := OrderedCollection new.
+       timeStamp := TimeStamp now.
+       durations := Dictionary new.!
-       timeStamp := TimeStamp now!

Item was changed:
  ----- Method: TestResult>>printOn: (in category 'printing') -----
  printOn: aStream
        aStream
                nextPutAll: self runCount printString;
+               nextPutAll: ' run in ';
+               nextPutAll: (Duration milliSeconds: self duration) printString;
+               nextPutAll: ', ';
-               nextPutAll: ' run, ';
                nextPutAll: self expectedPassCount printString;
                nextPutAll: ' passes, ';
                nextPutAll: self expectedDefectCount printString;
                nextPutAll:' expected failures, ';
                nextPutAll: self unexpectedFailureCount printString;
                nextPutAll: ' failures, ';
                nextPutAll: self unexpectedErrorCount printString;
                nextPutAll:' errors, ';
                nextPutAll: self unexpectedPassCount printString;
                nextPutAll:' unexpected passes'.!

Item was added:
+ ----- Method: TestResult>>runCaseMeasured: (in category 'running') -----
+ runCaseMeasured: aTestCase
+
+       self durations
+               at: aTestCase
+               put: [self runCase: aTestCase] timeToRunWithoutGC.!

Item was changed:
  ----- Method: TestResult>>selectResultsForTestCase: (in category 'history') -----
  selectResultsForTestCase: aTestCaseClass
+       | passedSelectors errorsSelectors failuresSelectors testCaseDurations |
+       
-       | passedSelectors errorsSelectors failuresSelectors |
        passedSelectors := self passed
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect: [:testCase | testCase selector].
        errorsSelectors := self errors
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect:  [:testCase | testCase selector].
        failuresSelectors := self failures
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect:  [:testCase | testCase selector].
+
+       testCaseDurations := Dictionary new.
+       self durations keysAndValuesDo: [:testCase :milliseconds |
+               testCase class == aTestCaseClass ifTrue: [testCaseDurations at: testCase selector put: milliseconds]].         
+
+       ^ self class newTestDictionary
+               at: #timeStamp put: self timeStamp; "Keep this result's time stamp."
-       
-       ^ self class newTestDictionary
                at: #passed put: passedSelectors asSet;
                at: #failures put: failuresSelectors asSet;
                at: #errors put: errorsSelectors asSet;
+               at: #durations put: testCaseDurations;
+               at: #duration put: (testCaseDurations inject: 0 into: [:sum :each | sum + each]);
                yourself
                !




Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: SUnit-mt.117.mcz

Chris Muller-3
Woops, I misread the + Timestamp line, and in context of these new timings, thought you had added it.  Sorry Marcel.  :)

Even without knowing, you were still kind to offer to begin that clean up.  No expectations, but if you have time next time, thank you.  :)

Best,
  Chris

On Fri, Sep 6, 2019 at 12:53 AM Marcel Taeumel <[hidden email]> wrote:
Hi Chris,

sure. I didn't touch that part yet, but I can clean that up in SUnit. :-) For the measurements, I use plain milliseconds and Duration.

Best,
Marcel

Am 05.09.2019 22:17:40 schrieb Chris Muller <[hidden email]>:

Hey Marcel, I think we're trying to get to a place where we can deprecate TimeStamp.  Would you mind using DateAndTime instead?

Best,
  Chris

On Wed, Sep 4, 2019 at 10:27 AM <[hidden email]> wrote:
Marcel Taeumel uploaded a new version of SUnit to project The Trunk:
http://source.squeak.org/trunk/SUnit-mt.117.mcz

==================== Summary ====================

Name: SUnit-mt.117
Author: mt
Time: 4 September 2019, 5:27:53.689072 pm
UUID: ca737f98-f12d-48c1-bb86-028b96fe0cf4
Ancestors: SUnit-mt.116

Measure the time to run a test and store it into the test-case history.

=============== Diff against SUnit-mt.116 ===============

Item was changed:
  ----- Method: TestCase>>run: (in category 'running') -----
  run: aResult
+       aResult runCaseMeasured: self.
-       aResult runCase: self.
  !

Item was changed:
  Object subclass: #TestResult
+       instanceVariableNames: 'timeStamp failures errors passed durations'
-       instanceVariableNames: 'timeStamp failures errors passed'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'SUnit-Kernel'!

  !TestResult commentStamp: '<historical>' prior: 0!
  This is a Collecting Parameter for the running of a bunch of tests. TestResult is an interesting object to subclass or substitute. #runCase: is the external protocol you need to reproduce. Kent has seen TestResults that recorded coverage information and that sent email when they were done.!

Item was added:
+ ----- Method: TestResult>>duration (in category 'accessing') -----
+ duration
+
+       ^ self durations inject: 0 into: [:sum :each | sum + each]!

Item was added:
+ ----- Method: TestResult>>durations (in category 'accessing') -----
+ durations
+       ^ durations!

Item was changed:
  ----- Method: TestResult>>initialize (in category 'initialization') -----
  initialize
        super initialize.
        passed := OrderedCollection new.
        failures := Set new.
        errors := OrderedCollection new.
+       timeStamp := TimeStamp now.
+       durations := Dictionary new.!
-       timeStamp := TimeStamp now!

Item was changed:
  ----- Method: TestResult>>printOn: (in category 'printing') -----
  printOn: aStream
        aStream
                nextPutAll: self runCount printString;
+               nextPutAll: ' run in ';
+               nextPutAll: (Duration milliSeconds: self duration) printString;
+               nextPutAll: ', ';
-               nextPutAll: ' run, ';
                nextPutAll: self expectedPassCount printString;
                nextPutAll: ' passes, ';
                nextPutAll: self expectedDefectCount printString;
                nextPutAll:' expected failures, ';
                nextPutAll: self unexpectedFailureCount printString;
                nextPutAll: ' failures, ';
                nextPutAll: self unexpectedErrorCount printString;
                nextPutAll:' errors, ';
                nextPutAll: self unexpectedPassCount printString;
                nextPutAll:' unexpected passes'.!

Item was added:
+ ----- Method: TestResult>>runCaseMeasured: (in category 'running') -----
+ runCaseMeasured: aTestCase
+
+       self durations
+               at: aTestCase
+               put: [self runCase: aTestCase] timeToRunWithoutGC.!

Item was changed:
  ----- Method: TestResult>>selectResultsForTestCase: (in category 'history') -----
  selectResultsForTestCase: aTestCaseClass
+       | passedSelectors errorsSelectors failuresSelectors testCaseDurations |
+       
-       | passedSelectors errorsSelectors failuresSelectors |
        passedSelectors := self passed
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect: [:testCase | testCase selector].
        errorsSelectors := self errors
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect:  [:testCase | testCase selector].
        failuresSelectors := self failures
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect:  [:testCase | testCase selector].
+
+       testCaseDurations := Dictionary new.
+       self durations keysAndValuesDo: [:testCase :milliseconds |
+               testCase class == aTestCaseClass ifTrue: [testCaseDurations at: testCase selector put: milliseconds]].         
+
+       ^ self class newTestDictionary
+               at: #timeStamp put: self timeStamp; "Keep this result's time stamp."
-       
-       ^ self class newTestDictionary
                at: #passed put: passedSelectors asSet;
                at: #failures put: failuresSelectors asSet;
                at: #errors put: errorsSelectors asSet;
+               at: #durations put: testCaseDurations;
+               at: #duration put: (testCaseDurations inject: 0 into: [:sum :each | sum + each]);
                yourself
                !





Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: SUnit-mt.117.mcz

Jakob Reschke-2
In reply to this post by commits-2
I think this broke smalltalkCI.

Running suite "Squeak64-trunk on Travis CI (32.1)" with 316 tests.
509vvvvvvvvvvvvvvvvvv MessageNotUnderstood: SCISqueakTestRunner>>runCaseMeasured: vvvvvvvvvvvvvvvvvv
510The time is 2019-09-07T11:42:29.61308+00:00
511SCISqueakTestRunner(Object)>>doesNotUnderstand: #runCaseMeasured:
512FSBreadthFirstGuideTest(TestCase)>>run:
513[] in SCISqueakTestRunner(SCITestRunner)>>runAll


<[hidden email]> schrieb am Mi., 4. Sep. 2019, 17:28:
Marcel Taeumel uploaded a new version of SUnit to project The Trunk:
http://source.squeak.org/trunk/SUnit-mt.117.mcz

==================== Summary ====================

Name: SUnit-mt.117
Author: mt
Time: 4 September 2019, 5:27:53.689072 pm
UUID: ca737f98-f12d-48c1-bb86-028b96fe0cf4
Ancestors: SUnit-mt.116

Measure the time to run a test and store it into the test-case history.

=============== Diff against SUnit-mt.116 ===============

Item was changed:
  ----- Method: TestCase>>run: (in category 'running') -----
  run: aResult
+       aResult runCaseMeasured: self.
-       aResult runCase: self.
  !

Item was changed:
  Object subclass: #TestResult
+       instanceVariableNames: 'timeStamp failures errors passed durations'
-       instanceVariableNames: 'timeStamp failures errors passed'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'SUnit-Kernel'!

  !TestResult commentStamp: '<historical>' prior: 0!
  This is a Collecting Parameter for the running of a bunch of tests. TestResult is an interesting object to subclass or substitute. #runCase: is the external protocol you need to reproduce. Kent has seen TestResults that recorded coverage information and that sent email when they were done.!

Item was added:
+ ----- Method: TestResult>>duration (in category 'accessing') -----
+ duration
+
+       ^ self durations inject: 0 into: [:sum :each | sum + each]!

Item was added:
+ ----- Method: TestResult>>durations (in category 'accessing') -----
+ durations
+       ^ durations!

Item was changed:
  ----- Method: TestResult>>initialize (in category 'initialization') -----
  initialize
        super initialize.
        passed := OrderedCollection new.
        failures := Set new.
        errors := OrderedCollection new.
+       timeStamp := TimeStamp now.
+       durations := Dictionary new.!
-       timeStamp := TimeStamp now!

Item was changed:
  ----- Method: TestResult>>printOn: (in category 'printing') -----
  printOn: aStream
        aStream
                nextPutAll: self runCount printString;
+               nextPutAll: ' run in ';
+               nextPutAll: (Duration milliSeconds: self duration) printString;
+               nextPutAll: ', ';
-               nextPutAll: ' run, ';
                nextPutAll: self expectedPassCount printString;
                nextPutAll: ' passes, ';
                nextPutAll: self expectedDefectCount printString;
                nextPutAll:' expected failures, ';
                nextPutAll: self unexpectedFailureCount printString;
                nextPutAll: ' failures, ';
                nextPutAll: self unexpectedErrorCount printString;
                nextPutAll:' errors, ';
                nextPutAll: self unexpectedPassCount printString;
                nextPutAll:' unexpected passes'.!

Item was added:
+ ----- Method: TestResult>>runCaseMeasured: (in category 'running') -----
+ runCaseMeasured: aTestCase
+
+       self durations
+               at: aTestCase
+               put: [self runCase: aTestCase] timeToRunWithoutGC.!

Item was changed:
  ----- Method: TestResult>>selectResultsForTestCase: (in category 'history') -----
  selectResultsForTestCase: aTestCaseClass
+       | passedSelectors errorsSelectors failuresSelectors testCaseDurations |
+       
-       | passedSelectors errorsSelectors failuresSelectors |
        passedSelectors := self passed
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect: [:testCase | testCase selector].
        errorsSelectors := self errors
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect:  [:testCase | testCase selector].
        failuresSelectors := self failures
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect:  [:testCase | testCase selector].
+
+       testCaseDurations := Dictionary new.
+       self durations keysAndValuesDo: [:testCase :milliseconds |
+               testCase class == aTestCaseClass ifTrue: [testCaseDurations at: testCase selector put: milliseconds]].         
+
+       ^ self class newTestDictionary
+               at: #timeStamp put: self timeStamp; "Keep this result's time stamp."
-       
-       ^ self class newTestDictionary
                at: #passed put: passedSelectors asSet;
                at: #failures put: failuresSelectors asSet;
                at: #errors put: errorsSelectors asSet;
+               at: #durations put: testCaseDurations;
+               at: #duration put: (testCaseDurations inject: 0 into: [:sum :each | sum + each]);
                yourself
                !




Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: SUnit-mt.117.mcz

marcel.taeumel
Well, smalltalkCI did a full source copy of Squeak's TestRunner. It should then also copy TestResult and TestCase, I suppose. :-)

Best,
Marcel

Am 07.09.2019 16:01:48 schrieb Jakob Reschke <[hidden email]>:

I think this broke smalltalkCI.

Running suite "Squeak64-trunk on Travis CI (32.1)" with 316 tests.
509vvvvvvvvvvvvvvvvvv MessageNotUnderstood: SCISqueakTestRunner>>runCaseMeasured: vvvvvvvvvvvvvvvvvv
510The time is 2019-09-07T11:42:29.61308+00:00
511SCISqueakTestRunner(Object)>>doesNotUnderstand: #runCaseMeasured:
512FSBreadthFirstGuideTest(TestCase)>>run:
513[] in SCISqueakTestRunner(SCITestRunner)>>runAll


<[hidden email]> schrieb am Mi., 4. Sep. 2019, 17:28:
Marcel Taeumel uploaded a new version of SUnit to project The Trunk:
http://source.squeak.org/trunk/SUnit-mt.117.mcz

==================== Summary ====================

Name: SUnit-mt.117
Author: mt
Time: 4 September 2019, 5:27:53.689072 pm
UUID: ca737f98-f12d-48c1-bb86-028b96fe0cf4
Ancestors: SUnit-mt.116

Measure the time to run a test and store it into the test-case history.

=============== Diff against SUnit-mt.116 ===============

Item was changed:
  ----- Method: TestCase>>run: (in category 'running') -----
  run: aResult
+       aResult runCaseMeasured: self.
-       aResult runCase: self.
  !

Item was changed:
  Object subclass: #TestResult
+       instanceVariableNames: 'timeStamp failures errors passed durations'
-       instanceVariableNames: 'timeStamp failures errors passed'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'SUnit-Kernel'!

  !TestResult commentStamp: '<historical>' prior: 0!
  This is a Collecting Parameter for the running of a bunch of tests. TestResult is an interesting object to subclass or substitute. #runCase: is the external protocol you need to reproduce. Kent has seen TestResults that recorded coverage information and that sent email when they were done.!

Item was added:
+ ----- Method: TestResult>>duration (in category 'accessing') -----
+ duration
+
+       ^ self durations inject: 0 into: [:sum :each | sum + each]!

Item was added:
+ ----- Method: TestResult>>durations (in category 'accessing') -----
+ durations
+       ^ durations!

Item was changed:
  ----- Method: TestResult>>initialize (in category 'initialization') -----
  initialize
        super initialize.
        passed := OrderedCollection new.
        failures := Set new.
        errors := OrderedCollection new.
+       timeStamp := TimeStamp now.
+       durations := Dictionary new.!
-       timeStamp := TimeStamp now!

Item was changed:
  ----- Method: TestResult>>printOn: (in category 'printing') -----
  printOn: aStream
        aStream
                nextPutAll: self runCount printString;
+               nextPutAll: ' run in ';
+               nextPutAll: (Duration milliSeconds: self duration) printString;
+               nextPutAll: ', ';
-               nextPutAll: ' run, ';
                nextPutAll: self expectedPassCount printString;
                nextPutAll: ' passes, ';
                nextPutAll: self expectedDefectCount printString;
                nextPutAll:' expected failures, ';
                nextPutAll: self unexpectedFailureCount printString;
                nextPutAll: ' failures, ';
                nextPutAll: self unexpectedErrorCount printString;
                nextPutAll:' errors, ';
                nextPutAll: self unexpectedPassCount printString;
                nextPutAll:' unexpected passes'.!

Item was added:
+ ----- Method: TestResult>>runCaseMeasured: (in category 'running') -----
+ runCaseMeasured: aTestCase
+
+       self durations
+               at: aTestCase
+               put: [self runCase: aTestCase] timeToRunWithoutGC.!

Item was changed:
  ----- Method: TestResult>>selectResultsForTestCase: (in category 'history') -----
  selectResultsForTestCase: aTestCaseClass
+       | passedSelectors errorsSelectors failuresSelectors testCaseDurations |
+       
-       | passedSelectors errorsSelectors failuresSelectors |
        passedSelectors := self passed
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect: [:testCase | testCase selector].
        errorsSelectors := self errors
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect:  [:testCase | testCase selector].
        failuresSelectors := self failures
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect:  [:testCase | testCase selector].
+
+       testCaseDurations := Dictionary new.
+       self durations keysAndValuesDo: [:testCase :milliseconds |
+               testCase class == aTestCaseClass ifTrue: [testCaseDurations at: testCase selector put: milliseconds]].         
+
+       ^ self class newTestDictionary
+               at: #timeStamp put: self timeStamp; "Keep this result's time stamp."
-       
-       ^ self class newTestDictionary
                at: #passed put: passedSelectors asSet;
                at: #failures put: failuresSelectors asSet;
                at: #errors put: errorsSelectors asSet;
+               at: #durations put: testCaseDurations;
+               at: #duration put: (testCaseDurations inject: 0 into: [:sum :each | sum + each]);
                yourself
                !




Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: SUnit-mt.117.mcz

marcel.taeumel
I will revert that part of SUnit to make smalltalkCI work again.

Best,
Marcel

Am 09.09.2019 09:26:08 schrieb Marcel Taeumel <[hidden email]>:

Well, smalltalkCI did a full source copy of Squeak's TestRunner. It should then also copy TestResult and TestCase, I suppose. :-)

Best,
Marcel

Am 07.09.2019 16:01:48 schrieb Jakob Reschke <[hidden email]>:

I think this broke smalltalkCI.

Running suite "Squeak64-trunk on Travis CI (32.1)" with 316 tests.
509vvvvvvvvvvvvvvvvvv MessageNotUnderstood: SCISqueakTestRunner>>runCaseMeasured: vvvvvvvvvvvvvvvvvv
510The time is 2019-09-07T11:42:29.61308+00:00
511SCISqueakTestRunner(Object)>>doesNotUnderstand: #runCaseMeasured:
512FSBreadthFirstGuideTest(TestCase)>>run:
513[] in SCISqueakTestRunner(SCITestRunner)>>runAll


<[hidden email]> schrieb am Mi., 4. Sep. 2019, 17:28:
Marcel Taeumel uploaded a new version of SUnit to project The Trunk:
http://source.squeak.org/trunk/SUnit-mt.117.mcz

==================== Summary ====================

Name: SUnit-mt.117
Author: mt
Time: 4 September 2019, 5:27:53.689072 pm
UUID: ca737f98-f12d-48c1-bb86-028b96fe0cf4
Ancestors: SUnit-mt.116

Measure the time to run a test and store it into the test-case history.

=============== Diff against SUnit-mt.116 ===============

Item was changed:
  ----- Method: TestCase>>run: (in category 'running') -----
  run: aResult
+       aResult runCaseMeasured: self.
-       aResult runCase: self.
  !

Item was changed:
  Object subclass: #TestResult
+       instanceVariableNames: 'timeStamp failures errors passed durations'
-       instanceVariableNames: 'timeStamp failures errors passed'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'SUnit-Kernel'!

  !TestResult commentStamp: '<historical>' prior: 0!
  This is a Collecting Parameter for the running of a bunch of tests. TestResult is an interesting object to subclass or substitute. #runCase: is the external protocol you need to reproduce. Kent has seen TestResults that recorded coverage information and that sent email when they were done.!

Item was added:
+ ----- Method: TestResult>>duration (in category 'accessing') -----
+ duration
+
+       ^ self durations inject: 0 into: [:sum :each | sum + each]!

Item was added:
+ ----- Method: TestResult>>durations (in category 'accessing') -----
+ durations
+       ^ durations!

Item was changed:
  ----- Method: TestResult>>initialize (in category 'initialization') -----
  initialize
        super initialize.
        passed := OrderedCollection new.
        failures := Set new.
        errors := OrderedCollection new.
+       timeStamp := TimeStamp now.
+       durations := Dictionary new.!
-       timeStamp := TimeStamp now!

Item was changed:
  ----- Method: TestResult>>printOn: (in category 'printing') -----
  printOn: aStream
        aStream
                nextPutAll: self runCount printString;
+               nextPutAll: ' run in ';
+               nextPutAll: (Duration milliSeconds: self duration) printString;
+               nextPutAll: ', ';
-               nextPutAll: ' run, ';
                nextPutAll: self expectedPassCount printString;
                nextPutAll: ' passes, ';
                nextPutAll: self expectedDefectCount printString;
                nextPutAll:' expected failures, ';
                nextPutAll: self unexpectedFailureCount printString;
                nextPutAll: ' failures, ';
                nextPutAll: self unexpectedErrorCount printString;
                nextPutAll:' errors, ';
                nextPutAll: self unexpectedPassCount printString;
                nextPutAll:' unexpected passes'.!

Item was added:
+ ----- Method: TestResult>>runCaseMeasured: (in category 'running') -----
+ runCaseMeasured: aTestCase
+
+       self durations
+               at: aTestCase
+               put: [self runCase: aTestCase] timeToRunWithoutGC.!

Item was changed:
  ----- Method: TestResult>>selectResultsForTestCase: (in category 'history') -----
  selectResultsForTestCase: aTestCaseClass
+       | passedSelectors errorsSelectors failuresSelectors testCaseDurations |
+       
-       | passedSelectors errorsSelectors failuresSelectors |
        passedSelectors := self passed
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect: [:testCase | testCase selector].
        errorsSelectors := self errors
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect:  [:testCase | testCase selector].
        failuresSelectors := self failures
                                                select: [:testCase | testCase class == aTestCaseClass ] thenCollect:  [:testCase | testCase selector].
+
+       testCaseDurations := Dictionary new.
+       self durations keysAndValuesDo: [:testCase :milliseconds |
+               testCase class == aTestCaseClass ifTrue: [testCaseDurations at: testCase selector put: milliseconds]].         
+
+       ^ self class newTestDictionary
+               at: #timeStamp put: self timeStamp; "Keep this result's time stamp."
-       
-       ^ self class newTestDictionary
                at: #passed put: passedSelectors asSet;
                at: #failures put: failuresSelectors asSet;
                at: #errors put: errorsSelectors asSet;
+               at: #durations put: testCaseDurations;
+               at: #duration put: (testCaseDurations inject: 0 into: [:sum :each | sum + each]);
                yourself
                !