Skip to content

Commit

Permalink
Merge pull request #5 from ba-st/add_openssh_client_dependency
Browse files Browse the repository at this point in the history
Add ssh-client dependency to rowan image
  • Loading branch information
gcotelli authored Aug 14, 2023
2 parents e35e2df + 41e7541 commit 2948dab
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 89 deletions.
5 changes: 4 additions & 1 deletion source/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ FROM docker-gs64-server as docker-gs64-rowan

# Install git
RUN apt-get update \
&& apt-get install --assume-yes --no-install-recommends git \
&& apt-get install --assume-yes --no-install-recommends \
git \
ssh-client \
&& apt-get clean \
&& rm --recursive --force /var/lib/apt/lists/* /tmp/* /var/tmp/* \
;
Expand All @@ -140,6 +142,7 @@ RUN install -d --owner=${GS_USER} --group=users ${ROWAN_PROJECTS_HOME}
COPY --chown=${GS_USER}:users load-rowan-project.sh ${GEMSTONE_GLOBAL_DIR}/load-rowan-project.sh
COPY --chown=${GS_USER}:users run-tests.sh ${GEMSTONE_GLOBAL_DIR}/run-tests.sh
COPY --chown=${GS_USER}:users StdOutPrinter.gs ${GEMSTONE_GLOBAL_DIR}/StdOutPrinter.gs
COPY --chown=${GS_USER}:users StdOutTestReporter.gs ${GEMSTONE_GLOBAL_DIR}/StdOutTestReporter.gs

COPY --from=download --chown=${GS_USER}:users /tmp/extent0.rowan.dbf ${GEMSTONE_GLOBAL_DIR}/data/extent0.dbf
CMD ["./entrypoint.sh"]
113 changes: 113 additions & 0 deletions source/StdOutTestReporter.gs
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
set compile_env: 0
! ------------------- Class definition for StdOutTestReporter
expectvalue /Class
doit
Object subclass: 'StdOutTestReporter'
instVarNames: #()
classVars: #()
classInstVars: #()
poolDictionaries: #()
inDictionary: Globals
options: #()

%
! ------------------- Remove existing behavior from StdOutTestReporter
expectvalue /Metaclass3
doit
StdOutTestReporter removeAllMethods.
StdOutTestReporter class removeAllMethods.
%
set compile_env: 0
! ------------------- Instance methods for StdOutTestReporter
category: 'reporting'
method: StdOutTestReporter
runTestsForProjectNamed: aProjectName

| suite result sortBlock currentTestClass |

suite := (Rowan projectNamed: aProjectName) testSuite.

StdOutPrinter printLine: [:s |
s << 'Running suite ' << suite name << ' with ' << suite tests size asString << ' tests.'.
].

result := suite run.

StdOutPrinter
printLine: [:s | s << '.............'];
printLine: [:s | s << 'Finished running suite: ' << suite name ];
printLine: [:s | ];
printInfo: [:s | s << '##################################################'];
printInfo: [:s | s << ' ' << suite name];
printInfo: [:s | s << ' ' << result runCount asString << ' tests with ' << result failureCount asString << ' failures and ' << result errorCount asString << ' errors.' ];
printInfo: [:s | s << '##################################################'].

sortBlock := [:a :b | a class name < b class name or: [a class name = b class name and: [ a selector < b selector ]]].

StdOutPrinter
printLine: [:s | ];
printSuccess: [:s | s << '(' << result passedCount asString << ' tests passed)' ].

(result passed sort: sortBlock)
do: [:test |
currentTestClass = test class name
ifFalse: [
currentTestClass := test class name.
StdOutPrinter
printLine: [:s | ];
printLine: [:s | s << currentTestClass asString ]
].
StdOutPrinter printSuccess: [:s | s << '' << test selector asString ]
].

StdOutPrinter
printLine: [:s | ];
printWarning: [:s | s << '##########################'];
printWarning: [:s | s << ' ' << result failureCount asString << ' tests failed' ];
printWarning: [:s | s << '##########################'].

(result failures sort: sortBlock)
do: [:test |
currentTestClass = test class name
ifFalse: [
currentTestClass := test class name.
StdOutPrinter
printLine: [:s | ];
printLine: [:s | s << currentTestClass asString ]
].
StdOutPrinter printWarning: [:s | s << '' << test selector asString ]
].

StdOutPrinter
printLine: [:s | ];
printError: [:s | s << '##########################'];
printError: [:s | s << ' ' << result errorCount asString << ' tests errored' ];
printError: [:s | s << '##########################'].

(result errors sort: sortBlock)
do: [:test |
currentTestClass = test class name
ifFalse: [
currentTestClass := test class name.
StdOutPrinter
printLine: [:s | ];
printLine: [:s | s << currentTestClass asString ]
].
StdOutPrinter printError: [:s | s << '' << test selector asString ]
].

result hasPassed ifTrue: [
StdOutPrinter
printLine: [:s | ];
printSuccess: [:s | s << '#####################################################'];
printSuccess: [:s | s << '✓ Executed ' << result runCount asString << ' tests with ' << result failureCount asString << ' failures and ' << result errorCount asString << ' errors.' ];
printSuccess: [:s | s << '#####################################################']
] ifFalse: [
StdOutPrinter
printLine: [:s | ];
printError: [:s | s << '#####################################################'];
printError: [:s | s << '✗ Executed ' << result runCount asString << ' tests with ' << result failureCount asString << ' failures and ' << result errorCount asString << ' errors.' ];
printError: [:s | s << '#####################################################']
].
^ result hasPassed
%
91 changes: 3 additions & 88 deletions source/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ echo "Running ${PROJECT_NAME} tests..."

touch "${GEMSTONE_LOG_DIR}/running-tests.log"

echo "Installing stdout printer"
echo "Installing stdout printer & test reporter"

topaz -i -q <<EOF > "${GEMSTONE_LOG_DIR}/installing-stdout-support.log"
set gemstone gs64stone user SystemUser pass ${SYSTEM_USER_PASSWORD}
iferror exit 1
login
input StdOutPrinter.gs
input StdOutTestReporter.gs
commit
logout
exit 0
Expand All @@ -29,93 +30,7 @@ iferror exit 1
login
expectvalue true
doit
| suite result sortBlock currentTestClass |
suite := (Rowan projectNamed: '${PROJECT_NAME}') testSuite.
StdOutPrinter printLine: [:s |
s << 'Running suite ' << suite name << ' with ' << suite tests size asString << ' tests.'.
].
result := suite run.
StdOutPrinter
printLine: [:s | s << '.............'];
printLine: [:s | s << 'Finished running suite: ' << suite name ];
printLine: [:s | ];
printInfo: [:s | s << '##################################################'];
printInfo: [:s | s << ' ' << suite name];
printInfo: [:s | s << ' ' << result runCount asString << ' tests with ' << result failureCount asString << ' failures and ' << result errorCount asString << ' errors.' ];
printInfo: [:s | s << '##################################################'].
sortBlock := [:a :b | a class name < b class name or: [a class name = b class name and: [ a selector < b selector ]]].
StdOutPrinter
printLine: [:s | ];
printSuccess: [:s | s << '(' << result passedCount asString << ' tests passed)' ].
(result passed sort: sortBlock)
do: [:test |
currentTestClass = test class name
ifFalse: [
currentTestClass := test class name.
StdOutPrinter
printLine: [:s | ];
printLine: [:s | s << currentTestClass asString ]
].
StdOutPrinter printSuccess: [:s | s << ' ✓ ' << test selector asString ]
].
StdOutPrinter
printLine: [:s | ];
printWarning: [:s | s << '##########################'];
printWarning: [:s | s << ' ' << result failureCount asString << ' tests failed' ];
printWarning: [:s | s << '##########################'].
(result failures sort: sortBlock)
do: [:test |
currentTestClass = test class name
ifFalse: [
currentTestClass := test class name.
StdOutPrinter
printLine: [:s | ];
printLine: [:s | s << currentTestClass asString ]
].
StdOutPrinter printWarning: [:s | s << ' ✗ ' << test selector asString ]
].
StdOutPrinter
printLine: [:s | ];
printError: [:s | s << '##########################'];
printError: [:s | s << ' ' << result errorCount asString << ' tests errored' ];
printError: [:s | s << '##########################'].
(result errors sort: sortBlock)
do: [:test |
currentTestClass = test class name
ifFalse: [
currentTestClass := test class name.
StdOutPrinter
printLine: [:s | ];
printLine: [:s | s << currentTestClass asString ]
].
StdOutPrinter printError: [:s | s << ' ✗ ' << test selector asString ]
].
result hasPassed ifTrue: [
StdOutPrinter
printLine: [:s | ];
printSuccess: [:s | s << '#####################################################'];
printSuccess: [:s | s << '✓ Executed ' << result runCount asString << ' tests with ' << result failureCount asString << ' failures and ' << result errorCount asString << ' errors.' ];
printSuccess: [:s | s << '#####################################################']
] ifFalse: [
StdOutPrinter
printLine: [:s | ];
printError: [:s | s << '#####################################################'];
printError: [:s | s << '✗ Executed ' << result runCount asString << ' tests with ' << result failureCount asString << ' failures and ' << result errorCount asString << ' errors.' ];
printError: [:s | s << '#####################################################']
].
result hasPassed
StdOutTestReporter new runTestsForProjectNamed: '${PROJECT_NAME}'
%
commit
logout
Expand Down

0 comments on commit 2948dab

Please sign in to comment.