Skip to content

Commit

Permalink
Increase Coverage and update CI configuration (#229)
Browse files Browse the repository at this point in the history
* remove unused method

* isEmpty not => notEmpty

* add another indirection on ALGWindowOperationsType for accessing `TheWorldMainDockingBar instance` and `Project current world`

* add test that mocks current project and docking bar buttons so that we can test these operations

* categorize all uncategorized

* add docking bar indirection to ALGWindowType as well

* add test that mocks docking bar for ALGWindowType

* Remove some more unused methods

* Forward another message from the InputWrapper to the InputField

Before we introduced the InputWrapper the message was covered from the tests.
I hope this gets it covered again :)

* Moved two window type tests from ALGTestAction to ALGTestTypes

* rename mock -> fake

* add tests that ensure interface of  `world` and `dockingBar` indirection

* Temporarily remove BOALGTest to check if it works then

* Add BOALGTest back in but without ensure internet connection

* Add ensure internet connection back in

* add totally sane way of communicating current git branch to the test runner

* separate baseline tests from normal tests, overwrite method for current git branch in CI script

Co-authored-by: Oliver Heß <[email protected]>
Co-authored-by: Oliver Heß <[email protected]>
Co-authored-by: Nils Lissner <[email protected]>
  • Loading branch information
4 people authored Aug 6, 2021
1 parent 34764d9 commit 8dec372
Show file tree
Hide file tree
Showing 58 changed files with 299 additions and 41 deletions.
18 changes: 18 additions & 0 deletions .baselinetests.smalltalk.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
SmalltalkCISpec {
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'Algernon',
#directory : 'packages',
#load : 'Tests',
#platforms : [ #squeak ],
#useLatestMetacello : true
}
],
#preLoading : [
'scripts/preLoading.st'
],
#testing : {
#categories : [ 'BaselineOfAlgernonTests' ]
}
}

26 changes: 26 additions & 0 deletions .github/workflows/smalltalk-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,29 @@ jobs:
timeout-minutes: 15
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
baselinetests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
smalltalk:
- Squeak64-5.3
runs-on: ${{ matrix.os }}
name: Baseline tests for ${{ matrix.smalltalk }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: hpi-swa/setup-smalltalkCI@v1
id: smalltalkci
with:
smalltalk-image: ${{ matrix.smalltalk }}
- run: |
ALGERNON_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo "Detected git branch: $ALGERNON_GIT_BRANCH"
FILE='packages/BaselineOfAlgernonTests.package/BOALGTest.class/instance/currentGitBranch.st'
sed "s/String empty/'$ALGERNON_GIT_BRANCH'/g" "$FILE" > tmpfile
mv tmpfile "$FILE"
- run: smalltalkci -s ${{ matrix.smalltalk }} ./.baselinetests.smalltalk.ston
shell: bash
timeout-minutes: 15
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .smalltalk.ston
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SmalltalkCISpec {
'scripts/preLoading.st'
],
#testing : {
#categories : [ 'BaselineOfAlgernonTests', 'AlgernonTests' ]
#categories : [ 'AlgernonTests' ]
}
}

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions packages/Algernon.package/ALGCore.class/methodProperties.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@
"itemProvider" : "J.J. 7/27/2015 17:16",
"itemProvider:" : "J.J. 7/27/2015 20:21",
"keyStroke:" : "NL 6/7/2021 20:05",
"lastActivationKeyTimestamp" : "fsa 6/16/2021 14:22",
"lastActivationKeyTimestamp:" : "fsa 6/16/2021 14:22",
"lastInputString" : "jRo 5/27/2020 17:35",
"lastInputString:" : "jRo 5/27/2020 17:35",
"moveCursorToEnd" : "beb 5/23/2020 15:58",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
forwarding
wouldAcceptKeyboardFocusUponTab

^ self inputfield wouldAcceptKeyboardFocusUponTab
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
"normalKeyStroke:" : "NM 6/1/2021 19:07",
"paragraph" : "NM 6/1/2021 19:07",
"selectAll" : "NM 6/1/2021 19:07",
"update:" : "NM 6/1/2021 19:02" } }
"update:" : "NM 6/1/2021 19:02",
"wouldAcceptKeyboardFocusUponTab" : "OH 8/5/2021 12:37" } }

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
hasEntries

^ self menuEntries isEmpty not
^ self menuEntries notEmpty
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
"allEntries" : "NL 7/14/2021 12:24",
"category" : "NL 7/5/2021 19:20",
"category:" : "NL 7/5/2021 19:21",
"enabledMenuSubmorphs" : "lm 7/4/2021 22:36",
"execute" : "NL 7/6/2021 12:16",
"hasDynamicMenu" : "b 7/13/2021 12:31",
"hasEntries" : "NL 7/5/2021 19:42",
"hasEntries" : "NM 8/4/2021 16:49",
"ifDynamicItem:" : "NL 7/12/2021 23:24",
"ifHasDynamicMenu:" : "b 7/13/2021 12:31",
"isDynamicItem" : "b 7/12/2021 18:54",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
action handlers
closeAllButWorkspaces

TheWorldMainDockingBar instance closeAllWindowsButWorkspaces
self dockingBar closeAllWindowsButWorkspaces
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
action handlers
closeAllWindows

TheWorldMainDockingBar instance closeAllWindowsUnsafe
self dockingBar closeAllWindowsUnsafe
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
action handlers
closeWithoutChanges

TheWorldMainDockingBar instance closeAllWindows
self dockingBar closeAllWindows
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
action handlers
collapseAllWindows

Project current world collapseAllWindows
self world collapseAllWindows
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
action handlers
dockingBar

^ TheWorldMainDockingBar instance
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
action handlers
world

^ Project current world
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
"allWindowActions" : "NL 7/6/2021 12:04",
"icon" : "NL 7/6/2021 11:55" },
"instance" : {
"closeAllButWorkspaces" : "NL 7/6/2021 12:03",
"closeAllWindows" : "NL 7/6/2021 12:03",
"closeWithoutChanges" : "NL 7/6/2021 12:03",
"collapseAllWindows" : "NL 7/6/2021 12:01",
"closeAllButWorkspaces" : "NM 8/4/2021 17:20",
"closeAllWindows" : "NM 8/4/2021 17:20",
"closeWithoutChanges" : "NM 8/4/2021 17:20",
"collapseAllWindows" : "NM 8/4/2021 17:21",
"createAction" : "NL 7/6/2021 11:59",
"createListOfAlgeractions" : "NL 7/6/2021 11:56",
"dockingBar" : "NM 8/4/2021 17:21",
"name" : "NL 7/6/2021 11:59",
"rankBonus" : "NL 7/6/2021 11:58",
"typeName" : "NL 7/6/2021 11:58" } }
"typeName" : "NL 7/6/2021 11:58",
"world" : "NM 8/4/2021 17:21" } }
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
action handlers
closeAllWindowsButThis
TheWorldMainDockingBar instance closeAllWindowsBut: self typeObject
self dockingBar closeAllWindowsBut: self typeObject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
action handlers
closeAllWindowsLikeThis
TheWorldMainDockingBar instance closeAllWindowsLike: self typeObject
self dockingBar closeAllWindowsLike: self typeObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
action handlers
dockingBar

^ TheWorldMainDockingBar instance
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"visibleWindows" : "lm 5/25/2021 21:14" },
"instance" : {
"bringWindowToFront" : "b 5/27/2021 12:51",
"closeAllWindowsButThis" : "lm 5/25/2021 21:01",
"closeAllWindowsLikeThis" : "lm 5/25/2021 21:03",
"closeAllWindowsButThis" : "NM 8/4/2021 18:37",
"closeAllWindowsLikeThis" : "NM 8/4/2021 18:37",
"closeWindow" : "lm 5/25/2021 20:56",
"collapseWindow" : "lm 5/25/2021 20:47",
"contractWindow" : "lm 5/25/2021 20:53",
Expand All @@ -18,6 +18,7 @@
"createActionContract" : "lm 5/25/2021 21:35",
"createActionExpand" : "lm 5/25/2021 21:35",
"createListOfAlgeractions" : "lm 5/25/2021 21:11",
"dockingBar" : "NM 8/4/2021 18:37",
"expandWindow" : "lm 5/25/2021 20:52",
"hasChildren" : "lm 5/25/2021 21:37",
"name" : "lm 5/25/2021 21:16",
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
dockingBar

^ self mockedDockingBar
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
initialize-release
initialize

self
mockedDockingBar: (ALGMockedObject newWithMethods: #(
closeAllWindowsButWorkspaces
closeAllWindowsUnsafe
closeAllWindows ));
mockedWorld: (ALGMockedObject newWithMethods: #(collapseAllWindows))
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
mockedDockingBar: anObject
mockedDockingBar := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
mockedDockingBar
^ mockedDockingBar
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
mockedWorld: anObject
mockedWorld := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
mockedWorld
^ mockedWorld
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
world

^ self mockedWorld
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"class" : {
},
"instance" : {
"dockingBar" : "NM 8/4/2021 17:46",
"initialize" : "NM 8/4/2021 17:30",
"mockedDockingBar" : "NM 8/4/2021 17:29",
"mockedDockingBar:" : "NM 8/4/2021 17:29",
"mockedWorld" : "NM 8/4/2021 17:29",
"mockedWorld:" : "NM 8/4/2021 17:29",
"world" : "NM 8/4/2021 17:46" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"category" : "AlgernonTests",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
"mockedWorld",
"mockedDockingBar" ],
"name" : "ALGFakeWindowOperationsType",
"pools" : [
],
"super" : "ALGWindowOperationsType",
"type" : "normal" }
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
dockingBar

^ self mockedDockingBar
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
initialize-release
initialize

self mockedDockingBar: (
ALGMockedObject newWithMethods: #(
closeAllWindowsBut:
closeAllWindowsLike: ))
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
mockedDockingBar: anObject
mockedDockingBar := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
mockedDockingBar
^ mockedDockingBar
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"class" : {
},
"instance" : {
"dockingBar" : "NM 8/4/2021 18:40",
"initialize" : "NM 8/4/2021 18:39",
"mockedDockingBar" : "NM 8/4/2021 18:37",
"mockedDockingBar:" : "NM 8/4/2021 18:37" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"category" : "AlgernonTests",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
"mockedDockingBar" ],
"name" : "ALGFakeWindowType",
"pools" : [
],
"super" : "ALGWindowType",
"type" : "normal" }
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
instance creation
newWithMethods: aCollection

^ self new
mockedMethods: aCollection asSet;
calls: Dictionary new;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
calls: anObject
calls := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
calls
^ calls
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mocking
doesNotUnderstand: aMessage

^ (self mockedMethods includes: aMessage selector)
ifTrue: [ self recordCall: aMessage ]
ifFalse: [ super doesNotUnderstand: aMessage ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
mockedMethods: anObject
mockedMethods := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
mockedMethods
^ mockedMethods
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
mocking
recordCall: aMessage

| callCollection |
callCollection := self calls
at: aMessage selector
ifAbsentPut: [ OrderedCollection new ].
callCollection add: aMessage
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"class" : {
"newWithMethods:" : "NM 8/4/2021 17:27" },
"instance" : {
"calls" : "NM 8/4/2021 17:27",
"calls:" : "NM 8/4/2021 17:27",
"doesNotUnderstand:" : "NM 8/4/2021 17:47",
"mockedMethods" : "NM 8/4/2021 17:27",
"mockedMethods:" : "NM 8/4/2021 17:27",
"recordCall:" : "NM 8/5/2021 21:20" } }
Loading

0 comments on commit 8dec372

Please sign in to comment.