Skip to content

Instantly share code, notes, and snippets.

@brisberg
Created June 16, 2020 17:59
Show Gist options
  • Save brisberg/e2029e0827b03e1919d52d392520bcb9 to your computer and use it in GitHub Desktop.
Save brisberg/e2029e0827b03e1919d52d392520bcb9 to your computer and use it in GitHub Desktop.
Logged output of Screeps-server-mockup unit tests
screeps-server-mockup git:(master) ✗ yarn test
yarn run v1.22.4
$ mocha --ui tdd
Basics tests
info: Server version 4.1.5
info: Starting storage process.
info: [storage] process 73670 started
info: Starting engine processes.
info: [engine_runner] process 73671 started
info: [engine_processor] process 73672 started
✓ Starting server and running a few ticks without error
Storage connection lost
info: [storage] process 73670 exited by signal SIGTERM
info: Server version 4.1.5
info: Starting storage process.
info: [storage] process 73673 started
info: Starting engine processes.
info: [engine_runner] process 73674 started
info: [engine_processor] process 73675 started
✓ Setting options in server constructor
info: Starting storage process.
Storage connection lost
info: [storage] process 73681 started
info: [storage] process 73673 exited by signal SIGTERM
info: Server version 4.1.5
info: Starting engine processes.
info: [engine_runner] process 73683 started
info: [engine_processor] process 73684 started
✓ Running user code
Storage connection lost
info: [storage] process 73681 exited by signal SIGTERM
info: Starting storage process.
info: [storage] process 73686 started
info: Server version 4.1.5
info: Starting engine processes.
info: [engine_runner] process 73687 started
info: [engine_processor] process 73688 started
✓ Getting current tick
TerrainMatrix tests
✓ Setting and getting values
✓ Serializing and unserializing
Storage connection lost
info: [storage] process 73686 exited by signal SIGTERM
User tests
✓ Getting basic user attributes and statistics
Storage connection lost
info: [engine_processor] process 73672 stopped
info: [engine_runner] process 73671 stopped
Storage connection lost { Error: connect ECONNREFUSED 127.0.0.1:21025
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 21025 }
info: [engine_processor] process 73675 stopped
info: [engine_runner] process 73674 stopped
✓ Getting segments contents
Storage connection lost
info: [engine_processor] process 73684 stopped
info: [engine_runner] process 73683 stopped
✓ Sending console commands and getting console logs
Storage connection lost
info: [engine_runner] process 73687 stopped
info: [engine_processor] process 73688 stopped
✓ Getting notifications and errors
World tests
Storage connection lost
✓ Getting internal constants and objects (internal)
Storage connection lost
✓ Getting game time (tick)
Storage connection lost
✓ Reseting world
Storage connection lost
Storage connection lost { Error: connect ECONNREFUSED 127.0.0.1:21025
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 21025 }
✓ Adding a bot
Storage connection lost
✓ Adding rooms
Storage connection lost
Storage connection lost { Error: connect ECONNREFUSED 127.0.0.1:21025
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 21025 }
✓ Getting and setting RoomObjetcs
Storage connection lost
✓ Getting and setting room terrain
Storage connection lost
✓ Defining a stub world
Storage connection lost
Storage connection lost { Error: connect ECONNREFUSED 127.0.0.1:21025
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 21025 }
✓ Reading terrain in game
Storage connection lost
Storage connection lost { Error: connect ECONNREFUSED 127.0.0.1:21025
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 21025 }
✓ Reading exits in game
20 passing (8s)
Storage connection lost
Storage connection lost { Error: connect ECONNREFUSED 127.0.0.1:21025
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 21025 }
Storage connection lost { Error: connect ECONNREFUSED 127.0.0.1:21025
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
diff --git a/test/basics.tests.js b/test/basics.tests.js
index 730974c..1b344db 100644
--- a/test/basics.tests.js
+++ b/test/basics.tests.js
@@ -16,6 +16,12 @@ suite('Basics tests', function () {
test('Starting server and running a few ticks without error', async function () {
server = new ScreepsServer();
+ server.on('error', (msg) => {
+ console.log(`error: ${msg}`)
+ });
+ server.on('info', (msg) => {
+ console.log(`info: ${msg}`)
+ });
await server.start();
for (let i = 0; i < 5; i += 1) {
await server.tick();
@@ -32,6 +38,12 @@ suite('Basics tests', function () {
mainLoopResetInterval: 10000,
};
server = new ScreepsServer(opts);
+ server.on('error', (msg) => {
+ console.log(`error: ${msg}`)
+ });
+ server.on('info', (msg) => {
+ console.log(`info: ${msg}`)
port: 21025 }
Storage connection lost { Error: connect ECONNREFUSED 127.0.0.1:21025
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 21025 }
Storage connection lost { Error: connect ECONNREFUSED 127.0.0.1:21025
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 21025 }
Storage connection lost { Error: connect ECONNREFUSED 127.0.0.1:21025
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 21025 }
Storage connection lost { Error: connect ECONNREFUSED 127.0.0.1:21025
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 21025 }
Storage connection lost { Error: connect ECONNREFUSED 127.0.0.1:21025
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 21025 }
Storage connection lost { Error: connect ECONNREFUSED 127.0.0.1:21025
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 21025 }
^C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment