Skip to content

Commit

Permalink
Merge pull request Superalgos#4974 from Superalgos/develop
Browse files Browse the repository at this point in the history
Updating Master Version to 1.5.0
  • Loading branch information
BastianMuc authored Sep 1, 2023
2 parents a37231c + 56dac24 commit b0a13ff
Show file tree
Hide file tree
Showing 1,705 changed files with 155,202 additions and 69,752 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm install --omit=optional
- name: Preparation
id: prep
run: node export-docs -l=_site -r=Superalgos
Expand Down
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ debug.log
*.db
Projects/Foundations/Icons/Thumbs.db
*.bat
# exception for installer batch
!clone_superalgos.bat
!launch-windows.bat
!create-shortcut-windows.bat
!uninstall-shortcut-windows.bat
*.exe
# exception for installer
!superalgos.exe
node_modules
launch.json
package-lock.json
Expand Down Expand Up @@ -49,3 +53,10 @@ Bitcoin-Factory/Test-Client/notebooks/ray_results/
Platform/WebServer/externalScripts/jquery-3.6.0.js
Platform/WebServer/externalScripts/jquery-ui.js
Platform/WebServer/externalScripts/jquery-3.6.0.js
knexfile.js

# Temporary translations
*_translated.json

# installer files
unins000.dat
104 changes: 88 additions & 16 deletions .tests/Environment.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ const expectedObject = {
WEB_SERVER_URL: 'localhost',
PLATFORM_WEB_SOCKETS_INTERFACE_PORT: 18041,
NETWORK_WEB_SOCKETS_INTERFACE_PORT: 18042,
DESKTOP_WEB_SOCKETS_INTERFACE_PORT: 16041,
DESKTOP_WEB_SOCKETS_INTERFACE_HOST: 'localhost',
DASHBOARDS_WEB_SOCKETS_INTERFACE_PORT: 18043,
SOCIALTRADING_WEB_SOCKETS_INTERFACE_PORT: 16041,
SOCIALTRADING_WEB_SOCKETS_INTERFACE_HOST: 'localhost',
PLATFORM_HTTP_INTERFACE_PORT: 34248,
DESKTOP_HTTP_INTERFACE_PORT: 33248,
SOCIALTRADING_HTTP_INTERFACE_PORT: 33248,
NETWORK_HTTP_INTERFACE_PORT: 31248,
PATH_TO_DATA_STORAGE: path.join(basePath, './Platform/My-Data-Storage'),
PATH_TO_PROJECTS: path.join(basePath, './Projects'),
Expand All @@ -30,15 +31,20 @@ const expectedObject = {
PATH_TO_PROJECTS_REQUIRED: path.join(basePath, './Projects'),
PATH_TO_PROJECT_SCHEMA: path.join(basePath, './Projects/ProjectsSchema.json'),
PATH_TO_PLATFORM: path.join(basePath, './Platform'),
PATH_TO_DESKTOP: './Desktop',
PATH_TO_SOCIALTRADING: './Social-Trading',
PATH_TO_DEFAULT_WORKSPACE: path.join(basePath, './Plugins/Foundations/Workspaces'),
PATH_TO_MY_WORKSPACES: path.join(basePath, './Platform/My-Workspaces'),
PATH_TO_SECRETS: path.join(basePath, './My-Secrets'),
PATH_TO_FONTS: path.join(basePath, './Platform/WebServer/Fonts'),
PATH_TO_BITCOIN_FACTORY: path.join(basePath, './Bitcoin-Factory'),
DESKTOP_APP_SIGNING_ACCOUNT: 'Social-Trading-Desktop-App-1',
DESKTOP_APP_MAX_OUTGOING_PEERS: 1,
DESKTOP_APP_MAX_OUTGOING_START_PEERS: 0,
SOCIALTRADING_APP_UI_TYPE: 'vueDev',
SOCIALTRADING_APP_SIGNING_ACCOUNT: 'Social-Trading-Desktop-App-1',
SOCIALTRADING_APP_MAX_OUTGOING_PEERS: 5,
SOCIALTRADING_APP_MAX_OUTGOING_START_PEERS: 1,
SOCIALTRADING_TARGET_NETWORK_TYPE: 'P2P Network',
SOCIALTRADING_TARGET_NETWORK_CODENAME: 'Testnet',
SOCIALTRADING_DEFAULT_SOCIAL_PERSONA: 'Social-Persona-1',
SOCIALTRADING_DEFAULT_SOCIAL_TRADING_BOT: 'Social-Trading-Bot-2',
TASK_SERVER_APP_MAX_OUTGOING_PEERS: 1,
TASK_SERVER_APP_MAX_OUTGOING_START_PEERS: 1,
MOBILE_APP_SIGNING_ACCOUNT: 'Social-Trading-Mobile-App-1',
Expand All @@ -48,23 +54,89 @@ const expectedObject = {
P2P_NETWORK_NODE_MAX_INCOMING_CLIENTS: 1000,
P2P_NETWORK_NODE_MAX_INCOMING_PEERS: 0,
P2P_NETWORK_NODE_MAX_OUTGOING_PEERS: 0,
DESKTOP_TARGET_NETWORK_TYPE: 'P2P Network',
DESKTOP_TARGET_NETWORK_CODENAME: 'Testnet',
TASK_SERVER_TARGET_NETWORK_TYPE: 'P2P Network',
TASK_SERVER_TARGET_NETWORK_CODENAME: 'Testnet',
DESKTOP_DEFAULT_SOCIAL_PERSONA: 'Social-Persona-1',
DESKTOP_DEFAULT_SOCIAL_TRADING_BOT: 'Social-Trading-Bot-1',
NPM_NEEDED_VERSION: '5',
NODE_NEEDED_VERSION: '12',
GIT_NEEDED_VERSION: '2',
EXTERNAL_SCRIPTS: [
'https://code.jquery.com/jquery-3.6.0.js',
'https://code.jquery.com/ui/1.13.0/jquery-ui.js'
]
'https://code.jquery.com/jquery-3.6.0.js',
'https://code.jquery.com/ui/1.13.0/jquery-ui.js'
],
}

describe('newEnvironment', () => {
it('should contain no new environment variables', () => {
expect(env.newEnvironment()).toEqual(expectedObject)
})
})

describe('logLevel argument validation tests', () => {
afterEach(() => {
process.argv = process.argv.slice(0,2);
})

const validTests = [
['logLevel=debug', 'debug'],
['logLevel=info', 'info'],
['logLevel=warn', 'warn'],
['logLevel=error', 'error'],
['logLevel = debug', 'debug'],
['logLevel = info', 'info'],
['logLevel = warn', 'warn'],
['logLevel = error', 'error'],
['logLevel debug', 'debug'],
['logLevel info', 'info'],
['logLevel warn', 'warn'],
['logLevel error', 'error'],
['-logLevel=debug', 'debug'],
['-logLevel=info', 'info'],
['-logLevel=warn', 'warn'],
['-logLevel=error', 'error'],
['-logLevel = debug', 'debug'],
['-logLevel = info', 'info'],
['-logLevel = warn', 'warn'],
['-logLevel = error', 'error'],
['-logLevel debug', 'debug'],
['-logLevel info', 'info'],
['-logLevel warn', 'warn'],
['-logLevel error', 'error'],
['--logLevel=debug', 'debug'],
['--logLevel=info', 'info'],
['--logLevel=warn', 'warn'],
['--logLevel=error', 'error'],
['--logLevel = debug', 'debug'],
['--logLevel = info', 'info'],
['--logLevel = warn', 'warn'],
['--logLevel = error', 'error'],
['--logLevel debug', 'debug'],
['--logLevel info', 'info'],
['--logLevel warn', 'warn'],
['--logLevel error', 'error']
]
validTests.forEach(([input, expected]) => {
it('should add the log level to the environment variables', () => {
process.argv.push(input)
const result = env.newEnvironment()
expect(result.LOG_LEVEL).toEqual(expected)
})
})

const invalidTests = [
'foo',
'logLevel',
'-logLevel',
'--logLevel',
'LogLevel',
'logLevel=undefined',
'-logLevel=undefined',
'--logLevel=undefined',
'-logLevel undefined',
'--logLevel undefined'
]
invalidTests.forEach((input) => {
it('should return undefined with an invalid argument', () => {
process.argv.push(input)
const result = env.newEnvironment()
expect(result.LOG_LEVEL).toEqual(undefined)
})
})
})
6 changes: 3 additions & 3 deletions .tests/Launch-Scripts/createShortcut.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ jest.mock('child_process', () => {
if (command === `$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut("${dir}"); $S.TargetPath = "${target}"; $S.IconLocation = "${icon}"; $S.Save()`) {
return 0
}
if (command === `cp ${name}.desktop ~/Desktop/${name}.desktop & cp ${name}.desktop ~/.local/share/applications/${name}.desktop`) {
if (command === `cp ${name}.desktop ~/Social-Trading/${name}.desktop & cp ${name}.desktop ~/.local/share/applications/${name}.desktop`) {
return 0
}
if (command === `chmod +x ${name}.command & cp ${name}.command ~/Desktop/${name}.command`) {
if (command === `chmod +x ${name}.command & cp ${name}.command ~/Social-Trading/${name}.command`) {
return 0
}
if (command === `npm install -g fileicon`) {
return 0
}
if (command === `./node_modules/fileicon/bin/fileicon set ~/Desktop/${name}.command ./Launch-Scripts/superalgos.ico`) {
if (command === `./node_modules/fileicon/bin/fileicon set ~/Social-Trading/${name}.command ./Launch-Scripts/superalgos.ico`) {
return 0
}
if (command === `npm uninstall -g fileicon`) {
Expand Down
6 changes: 3 additions & 3 deletions .tests/Launch-Scripts/runUninstall.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jest.mock('child_process', () => {
let cwd = __dirname
let dirs = cwd.split(path.sep)
let name = dirs[dirs.length - 1]
let desktop = path.join(os.homedir(), "Desktop", `${name}.lnk`)
let desktop = path.join(os.homedir(), "SocialTrading", `${name}.lnk`)
let startMenu = path.join(os.homedir(), "AppData", "Roaming", "Microsoft", "Windows", "Start Menu", "Programs", `${name}.lnk`)

return {
Expand All @@ -17,10 +17,10 @@ jest.mock('child_process', () => {
if (command === `del "${desktop}" & del "${startMenu}"`) {
return 0
}
if (command === `rm ~/Desktop/${name}.command`) {
if (command === `rm ~/SocialTrading/${name}.command`) {
return 0
}
if (command === `rm ~/Desktop/${name}.desktop & rm ~/.local/share/applications/${name}.desktop`) {
if (command === `rm ~/SocialTrading/${name}.desktop & rm ~/.local/share/applications/${name}.desktop`) {
return 0
}
})
Expand Down
Loading

0 comments on commit b0a13ff

Please sign in to comment.