Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack and heap for test command #430

Merged
merged 11 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 14 additions & 9 deletions .github/workflows/itest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,14 @@ concurrency:
group: itest-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
itest:
strategy:
matrix:
os: [ ubuntu-24.04, macos-15, windows-2022 ]
java: [ 21 ]
java: [ 22 ]
node: [ 16 ]
# lang: [Java, JavaScript]
lang: [ Java ]
parser: [ 0.48.2 ]
tag: [ 0.48.2 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -53,9 +51,16 @@ jobs:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- run: npm install
- run: |
- shell: bash
run: |
cd itest
node ../src/eoc.js "--parser=${{ matrix.parser }}" "--home-tag=${{ matrix.tag }}" --batch "--language=${{ matrix.lang }}" --easy dataize program
node ../src/eoc.js "--parser=${{ matrix.parser }}" "--home-tag=${{ matrix.tag }}" --batch --alone "--language=${{ matrix.lang }}" --easy dataize program
node ../src/eoc.js clean
node ../src/eoc.js "--parser=${{ matrix.parser }}" "--home-tag=${{ matrix.tag }}" --batch "--language=${{ matrix.lang }}" --easy test
declare -a opts=(
"../src/eoc.js"
"--batch"
"--language=${{ matrix.lang }}"
"--easy"
)
node "${opts[@]}" link
node "${opts[@]}" --alone dataize program
node "${opts[@]}" clean
node "${opts[@]}" test
2 changes: 1 addition & 1 deletion eo-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.48.2
0.49.1
2 changes: 1 addition & 1 deletion home-tag.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.48.2
0.49.1
4 changes: 4 additions & 0 deletions mvnw/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ SOFTWARE.
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<eo.version>undefined</eo.version>
<jeo.version>0.6.22</jeo.version>
<heap-size>256M</heap-size>
<stack-size>64M</stack-size>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -101,6 +103,8 @@ SOFTWARE.
<failIfNoTests>true</failIfNoTests>
<useFile>false</useFile>
<trimStackTrace>false</trimStackTrace>
<runOrder>random</runOrder>
<argLine>-Xmx${heap-size} -Xss${stack-size}</argLine>
</configuration>
</plugin>
</plugins>
Expand Down
8 changes: 7 additions & 1 deletion src/commands/java/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,11 @@ const {mvnw, flags} = require('../../mvnw');
* @return {Promise} of compile task
*/
module.exports = function(opts) {
return mvnw(['surefire:test'].concat(flags(opts)));
return mvnw(
[
'surefire:test',
`-Dstack-size=${opts.stack}`,
`-Dheap-size=${opts.heap}`,
].concat(flags(opts))
);
};
8 changes: 5 additions & 3 deletions src/eoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ program.command('link')

program.command('dataize')
.description('Run the single executable binary and dataize an object')
.option('--stack <size>', 'Set stack size for the virtual machine', '1M')
.option('--stack <size>', 'Set stack size for the virtual machine', '64M')
.option('--heap <size>', 'Set the heap size for the VM', '256M')
.action((str, opts) => {
clear(str);
Expand All @@ -333,6 +333,8 @@ program.command('dataize')

program.command('test')
.description('Run all visible unit tests')
.option('--stack <size>', 'Set stack size for the virtual machine', '64M')
.option('--heap <size>', 'Set the heap size for the VM', '256M')
.action((str, opts) => {
clear(str);
if (program.opts().alone == undefined) {
Expand All @@ -342,9 +344,9 @@ program.command('test')
.then((r) => coms().transpile(program.opts()))
.then((r) => coms().compile(program.opts()))
.then((r) => coms().link(program.opts()))
.then((r) => coms().test(program.opts()));
.then((r) => coms().test({...program.opts(), ...str}));
} else {
coms().test(program.opts());
coms().test({...program.opts(), ...str});
}
});

Expand Down
2 changes: 2 additions & 0 deletions test/commands/test_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ describe('test', function() {
'--easy',
`--parser=${parser}`,
`--home-tag=${hash}`,
'--stack=16M',
'--heap=128M',
'-s', path.resolve(home, 'src'),
'-t', path.resolve(home, 'target'),
`--language=${lang}`
Expand Down
Loading