Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d0dad6b
nicolasp025 Feb 5, 2026
8b1479c
nicolasp025 Feb 5, 2026
23ec5e0
nicolasp025 Feb 6, 2026
486cfed
nicolasp025 Feb 6, 2026
f911360
feat: adding a recorder window
nicolasp025 Feb 9, 2026
ea04d1d
feat: can inspect records on right click
nicolasp025 Feb 11, 2026
f31aa6c
feat: more info on recorder window and stop button
nicolasp025 Feb 11, 2026
0f39f0e
fix: could not hide with taskbar, also adding window icon
nicolasp025 Feb 11, 2026
a8720ec
feat: can inspect records in browser
nicolasp025 Feb 12, 2026
9f3f530
feat: colored records on browser
nicolasp025 Feb 12, 2026
5321071
fix: column for color in browser
nicolasp025 Feb 12, 2026
819f0b0
feat: new colors for browser
nicolasp025 Feb 12, 2026
1af3591
fix: cannot add a file twice
nicolasp025 Feb 13, 2026
c3b5de3
feat: timeline chart (data need to be fixed, also need refactoring)
nicolasp025 Feb 13, 2026
5cd5eb8
feat: dynamic colors for timeline
nicolasp025 Feb 16, 2026
70a8d12
fix: refactoring and display plots with nanoseconds
nicolasp025 Feb 16, 2026
a44b70a
refactoring: remove buttons attributes in browser class
nicolasp025 Feb 17, 2026
0ae7e5c
feat: adding a method for getting all record classes
nicolasp025 Feb 17, 2026
305073b
feat: filter the records
nicolasp025 Feb 18, 2026
318ba65
refactoring: records table and text color always white
nicolasp025 Feb 18, 2026
9f8477e
feat: inspect record in table when selected
nicolasp025 Feb 18, 2026
fa08e33
fix: on record inspect
nicolasp025 Feb 19, 2026
e5a6b5c
test: for the browser and the recorder
nicolasp025 Feb 20, 2026
8ad83d9
refactoring: DSRecordBrowserPresenter -> DSRecordBrowser
nicolasp025 Feb 20, 2026
a7d8bbc
fix: adding browser tests to baseline
nicolasp025 Feb 20, 2026
9838a45
fix: browser testing
nicolasp025 Feb 23, 2026
bece7be
refacto: browser lazy init and test fixes
nicolasp025 Feb 23, 2026
23ded92
fix: auto serialize and instrumentation after opening the recorder
nicolasp025 Feb 23, 2026
11e058a
fix: browser tests and git rebase
nicolasp025 Feb 24, 2026
9fd34a5
fix: recorder window was opened but never closed in tests
nicolasp025 Feb 24, 2026
c41e740
Merge branch 'feature/recordbrowser' into fix/recordbrowser
nicolasp025 Feb 24, 2026
d7c4d3b
Merge pull request #1 from nicolasp025/fix/recordbrowser
nicolasp025 Feb 24, 2026
4cf47b1
fix: update with PR changes
nicolasp025 Mar 2, 2026
ebc3aba
fix: in browser opening/closing tests
nicolasp025 Mar 2, 2026
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
17 changes: 8 additions & 9 deletions BaselineOfDebuggingSpy/BaselineOfDebuggingSpy.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ Class {
BaselineOfDebuggingSpy >> baseline: spec [

<baseline>

spec baseline: 'ExperimentModel' with: [
spec repository:
'github://Pharo-XP-Tools/ExperimentModel:main' ].

spec for: #common do: [
spec postLoadDoIt: #postloadAction.
spec package: 'DebuggingSpy'.
spec package: 'DebuggingSpy-Tests' ]
spec baseline: 'ExperimentModel' with: [ spec repository: 'github://Pharo-XP-Tools/ExperimentModel:main' ].

spec for: #common do: [
spec postLoadDoIt: #postloadAction.
spec package: 'DebuggingSpy'.
spec package: 'DebuggingSpy-Tests'.
spec package: 'DebuggingSpy-Browser'.
spec package: 'DebuggingSpy-Browser-Tests' ]
]

{ #category : 'baselines' }
Expand Down
264 changes: 264 additions & 0 deletions DebuggingSpy-Browser-Tests/DSRecordBrowserTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
Class {
#name : 'DSRecordBrowserTest',
#superclass : 'TestCase',
#instVars : [
'browser',
'logger'
],
#category : 'DebuggingSpy-Browser-Tests',
#package : 'DebuggingSpy-Browser-Tests'
}

{ #category : 'helpers' }
DSRecordBrowserTest >> filesPresenter [

^ browser presenterAt: #fileListPresenter
]

{ #category : 'helpers' }
DSRecordBrowserTest >> generateRecordsFile [
"Generates a file of random records and returns its file reference."

| recordFileRef writeStream randomNbOfRecords |
randomNbOfRecords := Random new nextInteger: 10.

recordFileRef := self temporaryDirectory / ('ds-spy-test-' , UUID new asString).
recordFileRef ensureCreateFile.
writeStream := recordFileRef writeStream.

writeStream nextPut: $[.

1 to: randomNbOfRecords do: [ :index |
writeStream nextPutAll: (STON toString: (self getRecordForIndex: index)).

index = randomNbOfRecords ifFalse: [
writeStream nextPut: $,.
writeStream crlf ] ].

writeStream nextPut: $].

writeStream close.

^ recordFileRef
]

{ #category : 'helpers' }
DSRecordBrowserTest >> getRecordForIndex: aNumber [
"Generates a record with specified number as dateTime (in seconds) and as windowId"

^ self recordClass new
dateTime: (DateAndTime fromSeconds: aNumber);
windowId: aNumber;
yourself
]

{ #category : 'helpers' }
DSRecordBrowserTest >> recordClass [

^ DSMouseEnterWindowRecord
]
Comment on lines +55 to +59
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this method, it seems to be useless

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It returns the class of records that would be generated in the (DSRecordBrowserTest >> getRecordForIndex: ) method, we could have used any random class of record but some of them may need additional attributes to be defined.

This method is also used in tests when we want to filter a class of records


{ #category : 'helpers' }
DSRecordBrowserTest >> recordsFilterPresenter [

^ browser presenterAt: #recordsFilter
]

{ #category : 'helpers' }
DSRecordBrowserTest >> recordsTablePresenter [

^ browser presenterAt: #recordsTablePresenter
]

{ #category : 'running' }
DSRecordBrowserTest >> setUp [

super setUp.
browser := DSRecordBrowser new
]

{ #category : 'running' }
DSRecordBrowserTest >> tearDown [

DSRecordBrowser resetBrowser.
super tearDown
]

{ #category : 'tests' }
DSRecordBrowserTest >> testAddFile [

| fileRef |
fileRef := self generateRecordsFile.

browser addFile: fileRef.
self assert: browser files size equals: 1.
self assert: self filesPresenter items size equals: 1.

self assert: self filesPresenter selectedItem equals: fileRef
]

{ #category : 'tests' }
DSRecordBrowserTest >> testAddFileWhenAlreadyInList [

| fileRef |
fileRef := self generateRecordsFile.

browser addFile: fileRef.
browser addFile: fileRef.
self assert: browser files size equals: 1.
self assert: self filesPresenter items size equals: 1.
self assert: self filesPresenter selectedItem equals: fileRef
]

{ #category : 'tests' }
DSRecordBrowserTest >> testBrowserEmpty [

self assertEmpty: browser files.
self assert: self filesPresenter items size equals: 0.
self assert: self filesPresenter selectedItem equals: nil.

]

{ #category : 'tests' }
DSRecordBrowserTest >> testClosingBrowser [

DSRecordBrowser toggleBrowser.
DSRecordBrowser toggleBrowser.
self deny: DSRecordBrowser uniqueInstance window isOpen
]

{ #category : 'tests' }
DSRecordBrowserTest >> testCreatingAndOpeningBrowser [

DSRecordBrowser toggleBrowser.
self assert: DSRecordBrowser uniqueInstance window isOpen.
DSRecordBrowser toggleBrowser
]

{ #category : 'tests' }
DSRecordBrowserTest >> testFilteringAClassOfRecords [

| fileRef history |
fileRef := self generateRecordsFile.
history := browser getHistoryFrom: fileRef.

browser addFile: fileRef.
self assert: self recordsTablePresenter roots size equals: history records size.

self recordsFilterPresenter sourceList selectItem: self recordClass.
self recordsFilterPresenter addSelected.

self assert: self recordsTablePresenter roots size equals: 0 "Since there is only one type of records in the generated file"
]

{ #category : 'tests' }
DSRecordBrowserTest >> testFilteringAllRecords [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that, for this test, it will be interessing to have an example file with different type of record (as you want to filter records).


| fileRef history |
fileRef := self generateRecordsFile.
history := browser getHistoryFrom: fileRef.

browser addFile: fileRef.
self assert: self recordsTablePresenter roots size equals: history records size.

self recordsFilterPresenter addAll.
self assert: self recordsTablePresenter roots size equals: 0
]

{ #category : 'tests' }
DSRecordBrowserTest >> testGetHistoryFrom [

| fileRef |
fileRef := self generateRecordsFile.
self assert: (browser getHistoryFrom: fileRef) class equals: DSRecordHistory
]

{ #category : 'tests' }
DSRecordBrowserTest >> testGetRecordColorAssociationsFrom [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is not clear for me, can you explain it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, as you want to check that different colors appears in your presenter, it will be interesting to have different type of records in your testing file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is meant to verify that each association contains a record and the correct associated color.

In that case, each record will be associated with the default color since we didn't defined any window for them, considering the color relies on the window and not the record.

I think that test is useful because it happened that for any obscure reason (that has been fixed), the colors may be not corresponding so I think we better verifying it.


| fileRef history colorAssociations |
fileRef := self generateRecordsFile.
history := browser getHistoryFrom: fileRef.
colorAssociations := browser getRecordColorAssociationsFrom: history windows.

history windows do: [ :window |
window events do: [ :record |
self assert: (colorAssociations anySatisfy: [ :association |
association key = record and: association value = (browser getWindowColorFrom: window) ]) ] ]
]

{ #category : 'tests' }
DSRecordBrowserTest >> testRemoveFile [

| fileRef1 fileRef2 |
fileRef1 := self generateRecordsFile.
fileRef2 := self generateRecordsFile.

browser addFile: fileRef1.
browser addFile: fileRef2.
browser removeFile: fileRef1.

self assert: browser files size equals: 1.
self assert: self filesPresenter items size equals: 1.
self assert: self filesPresenter selectedItem equals: fileRef2
]

{ #category : 'tests' }
DSRecordBrowserTest >> testRemoveLastFile [

| fileRef1 |
fileRef1 := self generateRecordsFile.

browser addFile: fileRef1.
browser removeFile: fileRef1.

self assert: browser files size equals: 0.
self assert: self filesPresenter items size equals: 0.
self assert: self filesPresenter selectedItem equals: nil
]

{ #category : 'tests' }
DSRecordBrowserTest >> testStartRecording [

self assert: browser recorderWindow isNil.
self deny: DSRecordRegistry autoSerialize.
self deny: DSSpy recordingSession.

browser startRecording.
self assert: DSSpy recordingSession.
self assert: DSRecordRegistry autoSerialize.
self deny: browser recorderWindow isNil.

browser stopRecording
]

{ #category : 'tests' }
DSRecordBrowserTest >> testUpdateRecordsTable [

| fileRef history presenterMock |
fileRef := self generateRecordsFile.
history := browser getHistoryFrom: fileRef.
presenterMock := MockObject new on: #selectedItem respond: fileRef.
browser updateRecordsTable: presenterMock.

self recordsTablePresenter roots do: [ :association |
self assert: (history records anySatisfy: [ :record | record uuid = association key uuid ]) ]
]

{ #category : 'tests' }
DSRecordBrowserTest >> testUpdateRecordsTableWhenAddingFile [

| fileRef history |
fileRef := self generateRecordsFile.
history := browser getHistoryFrom: fileRef.

browser addFile: fileRef.

self assert: self recordsTablePresenter roots size equals: history records size
]

{ #category : 'helpers' }
DSRecordBrowserTest >> timelinePresenter [

^ browser presenterAt: #graphicTimeline
]
51 changes: 51 additions & 0 deletions DebuggingSpy-Browser-Tests/DSRecorderWindowTest.class.st
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can add a testStartTimer testing that there is a fork running and that your different morph where updated?

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Class {
#name : 'DSRecorderWindowTest',
#superclass : 'TestCase',
#instVars : [
'window'
],
#category : 'DebuggingSpy-Browser-Tests',
#package : 'DebuggingSpy-Browser-Tests'
}

{ #category : 'running' }
DSRecorderWindowTest >> setUp [
super setUp.

window := DSTimerWindow new.
]

{ #category : 'tests' }
DSRecorderWindowTest >> testEmptyTimerWindow [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DSRecorderWindowTest >> testEmptyTimerWindow [
DSRecorderWindowTest >> testEmptyTimerMorph [


self assert: (Time readFrom: self timerMorph contents readStream) seconds equals: 0
]

{ #category : 'tests' }
DSRecorderWindowTest >> testTimeNow [

self assert: (Time readFrom: self timeNowMorph contents readStream) asSeconds equals: Time now asSeconds
]

{ #category : 'tests' }
DSRecorderWindowTest >> testTimer [

window startTimer.
(Delay forMilliseconds: 1000) wait.
window stopTimer.
self assert: window elapsedTime equals: 1
]

{ #category : 'layout' }
DSRecorderWindowTest >> timeNowMorph [
"Returns the window's timeNowMorph"

^ window readSlot: (DSTimerWindow slotNamed: #timeNowMorph)
]

{ #category : 'layout' }
DSRecorderWindowTest >> timerMorph [
"Returns the window's timerMorph."

^ window readSlot: (DSTimerWindow slotNamed: #timerMorph)
]
1 change: 1 addition & 0 deletions DebuggingSpy-Browser-Tests/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : 'DebuggingSpy-Browser-Tests' }
Loading