-
Notifications
You must be signed in to change notification settings - Fork 12
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
ValueError: Descending test id on line ... #50
Comments
@MoLow Any ideas? @ForbiddenEra We made a new release this morning. Can you please try |
this seems to reproduce on |
Oo, will take a peek - nice to see an alternative, I was tempted to whip up my own since the XML doesn't look too complex but no sense in re-inventing any wheels, I'll take a peek at that; fortunately I can have my tests still run properly and specify a reporter on the command line without using I should also mention that the XML that I did get out of it when removing nesting wasn't the greatest either; it didn't pick up any 'filenames' and split any of my test comments/descriptions up that had a <?xml version="1.0" encoding="utf-8"?>
<testsuites disabled="0" errors="0" failures="0" tests="17" time="4.4751723">
<testsuite disabled="0" errors="0" failures="0" name="tests/report" skipped="2" tests="17" time="4.4751723" hostname="ForbiddenEra">
<testcase name="- System Configuration Required Tests " time="0.003377">
<skipped type="skipped" message="System Configuration Required Tests"/>
</testcase>
<testcase name="- System Configuration Optional Tests" time="0.001361"/>
<testcase name="- System Configuration Optional Tests" time="0.002587"/>
<testcase name="- fileSize is too small" time="0.023804"/>
<testcase name="- fileSize is too large" time="0.033457"/>
<testcase name="- fileType is invalid" time="0.096726"/>
<testcase name="- fileType mismatch" time="0.003848"/>
<testcase name="- jpeg vs jpeg handling" time="0.831943"/>
<testcase name="- image dimensions too small" time="0.003943"/>
<testcase name="- image dimensions too large, resize (x>y)" time="0.444136"/>
<testcase name="- image dimensions too large, resize (y>x)" time="0.421050"/>
<testcase name="metadata stripping" time="0.368525" classname="- image exif"/>
<testcase name="- Main Validation Tests" time="2.231721"/>
<testcase name="- VirusTotal FAIL test - EICAR-STANDARD-ANTIVIRUS-TEST-FILE" time="0.001433"/>
<testcase name="1000x750-JPG.jpg" time="0.001964" classname="- VirusTotal PASS test - ..images"/>
<testcase name="- VirusTotal Tests" time="0.004483"/>
<testcase name="- PDF-Related Validation Tests " time="0.000814">
<skipped type="skipped" message="verify PDF was exported as JPG"/>
</testcase>
</testsuite>
</testsuites> Which results in Any comments on this? None of my tests are actually named with a I never tried I'll definitely try the mentioned reporter and if I find time I may also try @MoLow As I see you're the maintainer for the linked reporter, I figure it may be easier to leave my comments here, especially considering |
I tried installing Tried the <?xml version="1.0" encoding="utf-8"?>
<testsuites>
<testsuite name="Test Suite #1a" time="0.003282" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #1a/Test #1" time="0.000616" classname="test"/>
<testcase name="Test Suite #1a/Test #2" time="0.000163" classname="test"/>
<testsuite name="Test Suite #1b" time="0.000524" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #1b/Test #1" time="0.000183" classname="test"/>
<testcase name="Test Suite #1b/Test #2" time="0.000114" classname="test"/>
</testsuite>
<testsuite name="Test Suite #2" time="0.001196" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testsuite name="Test Group #1" time="0.000553" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #2/Test Group #1/Test #1" time="0.000199" classname="test"/>
<testcase name="Test Suite #2/Test Group #1/Test #2" time="0.000131" classname="test"/>
</testsuite>
<testsuite name="Test Group #2" time="0.000447" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #2/Test Group #2/Test #1" time="0.000136" classname="test"/>
<testcase name="Test Suite #2/Test Group #2/Test #2" time="0.000131" classname="test"/>
</testsuite>
</testsuite>
<testsuite name="Test Suite #3" time="0.000541" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #3/Test #1" time="0.000175" classname="test"/>
<testcase name="Test Suite #3/Test #2" time="0.000082" classname="test"/>
</testsuite>
<testsuite name="Test Suite #4" time="0.000302" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #4/Test #1" time="0.000100" classname="test"/>
<testcase name="Test Suite #4/Test #2" time="0.000078" classname="test"/>
</testsuite>
</testsuite>
</testsuites> So, all the other tests are wrapped in the first testcase.. I have a import testSuite1 from './test/testSuite1.js';
import testSuite2 from './test/testSuite2.js';
import testSuite3 from './test/testSuite3.js';
import testSuite4 from './test/testSuite4.js';
(async()=>{
await testSuite1();
await testSuite2();
await testSuite3();
await testSuite4();
})(); Each of these scripts exports a default function, eg:
import test from 'node:test';
import assert from 'node:assert/strict';
export default () => {
test('Test Suite #1a', async(t) => {
await t.test('Test Suite #1a/Test #1', async(tt) => {});
await t.test('Test Suite #1a/Test #2', async(tt) => {});
});
test('Test Suite #1b', async(t) => {
await t.test('Test Suite #1b/Test #1', async(tt) => {});
await t.test('Test Suite #1b/Test #2', async(tt) => {});
});
}
import test from 'node:test';
import assert from 'node:assert/strict';
export default () => {
test('Test Suite #2', async(t) => {
await t.test('Test Group #1', async(t) => {
await t.test('Test Suite #2/Test Group #1/Test #1', async(tt) => {});
await t.test('Test Suite #2/Test Group #1/Test #2', async(tt) => {});
});
await t.test('Test Group #2', async(t) => {
await t.test('Test Suite #2/Test Group #2/Test #1', async(tt) => {});
await t.test('Test Suite #2/Test Group #2/Test #2', async(tt) => {});
});
});
}); The TAP version 13
# Subtest: Test Suite \#1a
# Subtest: Test Suite \#1a/Test \#1
ok 1 - Test Suite \#1a/Test \#1
---
duration_ms: 0.6158
...
# Subtest: Test Suite \#1a/Test \#2
ok 2 - Test Suite \#1a/Test \#2
---
duration_ms: 0.1631
...
1..2
ok 1 - Test Suite \#1a
---
duration_ms: 3.2816
...
# Subtest: Test Suite \#1b
# Subtest: Test Suite \#1b/Test \#1
ok 1 - Test Suite \#1b/Test \#1
---
duration_ms: 0.1831
...
# Subtest: Test Suite \#1b/Test \#2
ok 2 - Test Suite \#1b/Test \#2
---
duration_ms: 0.1139
...
1..2
ok 2 - Test Suite \#1b
---
duration_ms: 0.5244
...
# Subtest: Test Suite \#2
# Subtest: Test Group \#1
# Subtest: Test Suite \#2/Test Group \#1/Test \#1
ok 1 - Test Suite \#2/Test Group \#1/Test \#1
---
duration_ms: 0.1986
...
# Subtest: Test Suite \#2/Test Group \#1/Test \#2
ok 2 - Test Suite \#2/Test Group \#1/Test \#2
---
duration_ms: 0.1305
...
1..2
ok 1 - Test Group \#1
---
duration_ms: 0.5529
...
# Subtest: Test Group \#2
# Subtest: Test Suite \#2/Test Group \#2/Test \#1
ok 1 - Test Suite \#2/Test Group \#2/Test \#1
---
duration_ms: 0.1363
...
# Subtest: Test Suite \#2/Test Group \#2/Test \#2
ok 2 - Test Suite \#2/Test Group \#2/Test \#2
---
duration_ms: 0.1311
...
1..2
ok 2 - Test Group \#2
---
duration_ms: 0.4465
...
1..2
ok 3 - Test Suite \#2
---
duration_ms: 1.1957
...
# Subtest: Test Suite \#3
# Subtest: Test Suite \#3/Test \#1
ok 1 - Test Suite \#3/Test \#1
---
duration_ms: 0.1747
...
# Subtest: Test Suite \#3/Test \#2
ok 2 - Test Suite \#3/Test \#2
---
duration_ms: 0.0815
...
1..2
ok 4 - Test Suite \#3
---
duration_ms: 0.5411
...
# Subtest: Test Suite \#4
# Subtest: Test Suite \#4/Test \#1
ok 1 - Test Suite \#4/Test \#1
---
duration_ms: 0.1002
...
# Subtest: Test Suite \#4/Test \#2
ok 2 - Test Suite \#4/Test \#2
---
duration_ms: 0.078
...
1..2
ok 5 - Test Suite \#4
---
duration_ms: 0.3025
...
1..5
# tests 5
# pass 5
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 37.9615 If I wrap the calls in <?xml version="1.0" encoding="utf-8"?>
<testsuites>
<testsuite name="All Tests" time="0.006668" disabled="0" errors="0" tests="5" failures="0" skipped="0">
<testsuite name="Test Suite #1a" time="0.002252" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #1a/Test #1" time="0.000739" classname="test"/>
<testcase name="Test Suite #1a/Test #2" time="0.000166" classname="test"/>
</testsuite>
<testsuite name="Test Suite #1b" time="0.000493" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #1b/Test #1" time="0.000155" classname="test"/>
<testcase name="Test Suite #1b/Test #2" time="0.000130" classname="test"/>
</testsuite>
<testsuite name="Test Suite #2" time="0.001196" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testsuite name="Test Group #1" time="0.000487" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #2/Test Group #1/Test #1" time="0.000183" classname="test"/>
<testcase name="Test Suite #2/Test Group #1/Test #2" time="0.000111" classname="test"/>
</testsuite>
<testsuite name="Test Group #2" time="0.000518" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #2/Test Group #2/Test #1" time="0.000225" classname="test"/>
<testcase name="Test Suite #2/Test Group #2/Test #2" time="0.000111" classname="test"/>
</testsuite>
</testsuite>
<testsuite name="Test Suite #3" time="0.000436" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #3/Test #1" time="0.000137" classname="test"/>
<testcase name="Test Suite #3/Test #2" time="0.000107" classname="test"/>
</testsuite>
<testsuite name="Test Suite #4" time="0.000423" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #4/Test #1" time="0.000131" classname="test"/>
<testcase name="Test Suite #4/Test #2" time="0.000116" classname="test"/>
</testsuite>
</testsuite>
</testsuites> Might be a workaround, though I don't really want everything wrapped into one test suite like that, what I'm after should look like this: <?xml version="1.0" encoding="utf-8"?>
<testsuites>
<testsuite name="Test Suite #1a" time="0.002252" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #1a/Test #1" time="0.000739" classname="test"/>
<testcase name="Test Suite #1a/Test #2" time="0.000166" classname="test"/>
</testsuite>
<testsuite name="Test Suite #1b" time="0.000493" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #1b/Test #1" time="0.000155" classname="test"/>
<testcase name="Test Suite #1b/Test #2" time="0.000130" classname="test"/>
</testsuite>
<testsuite name="Test Suite #2" time="0.001196" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testsuite name="Test Group #1" time="0.000487" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #2/Test Group #1/Test #1" time="0.000183" classname="test"/>
<testcase name="Test Suite #2/Test Group #1/Test #2" time="0.000111" classname="test"/>
</testsuite>
<testsuite name="Test Group #2" time="0.000518" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #2/Test Group #2/Test #1" time="0.000225" classname="test"/>
<testcase name="Test Suite #2/Test Group #2/Test #2" time="0.000111" classname="test"/>
</testsuite>
</testsuite>
<testsuite name="Test Suite #3" time="0.000436" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #3/Test #1" time="0.000137" classname="test"/>
<testcase name="Test Suite #3/Test #2" time="0.000107" classname="test"/>
</testsuite>
<testsuite name="Test Suite #4" time="0.000423" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #4/Test #1" time="0.000131" classname="test"/>
<testcase name="Test Suite #4/Test #2" time="0.000116" classname="test"/>
</testsuite>
</testsuites> I did have a reason previously for using a separate script to initiate the tests (eg. the Ditching that (and, of course, moving all the tests outside of the exported function) and using <?xml version="1.0" encoding="utf-8"?>
<testsuites>
<testsuite name="Test Suite #4" time="0.002965" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #4/Test #1" time="0.000654" classname="test"/>
<testcase name="Test Suite #4/Test #2" time="0.000122" classname="test"/>
<testsuite name="Test Suite #1a" time="0.003078" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #1a/Test #1" time="0.000916" classname="test"/>
<testcase name="Test Suite #1a/Test #2" time="0.000145" classname="test"/>
</testsuite>
<testsuite name="Test Suite #1b" time="0.000626" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #1b/Test #1" time="0.000185" classname="test"/>
<testcase name="Test Suite #1b/Test #2" time="0.000131" classname="test"/>
</testsuite>
<testsuite name="Test Suite #2" time="0.002739" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testsuite name="Test Group #1" time="0.001328" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #2/Test Group #1/Test #1" time="0.000424" classname="test"/>
<testcase name="Test Suite #2/Test Group #1/Test #2" time="0.000087" classname="test"/>
</testsuite>
<testsuite name="Test Group #2" time="0.000530" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #2/Test Group #2/Test #1" time="0.000107" classname="test"/>
<testcase name="Test Suite #2/Test Group #2/Test #2" time="0.000102" classname="test"/>
</testsuite>
</testsuite>
<testsuite name="Test Suite #3" time="0.002906" disabled="0" errors="0" tests="2" failures="0" skipped="0">
<testcase name="Test Suite #3/Test #1" time="0.000641" classname="test"/>
<testcase name="Test Suite #3/Test #2" time="0.000147" classname="test"/>
</testsuite>
</testsuite>
</testsuites> Here's the TAP version 13
# Subtest: Test Suite \#4
# Subtest: Test Suite \#4/Test \#1
ok 1 - Test Suite \#4/Test \#1
---
duration_ms: 0.6541
...
# Subtest: Test Suite \#4/Test \#2
ok 2 - Test Suite \#4/Test \#2
---
duration_ms: 0.1224
...
1..2
ok 1 - Test Suite \#4
---
duration_ms: 2.9651
...
# Subtest: Test Suite \#1a
# Subtest: Test Suite \#1a/Test \#1
ok 1 - Test Suite \#1a/Test \#1
---
duration_ms: 0.9159
...
# Subtest: Test Suite \#1a/Test \#2
ok 2 - Test Suite \#1a/Test \#2
---
duration_ms: 0.145
...
1..2
ok 2 - Test Suite \#1a
---
duration_ms: 3.0777
...
# Subtest: Test Suite \#1b
# Subtest: Test Suite \#1b/Test \#1
ok 1 - Test Suite \#1b/Test \#1
---
duration_ms: 0.1851
...
# Subtest: Test Suite \#1b/Test \#2
ok 2 - Test Suite \#1b/Test \#2
---
duration_ms: 0.131
...
1..2
ok 3 - Test Suite \#1b
---
duration_ms: 0.6262
...
# Subtest: Test Suite \#2
# Subtest: Test Group \#1
# Subtest: Test Suite \#2/Test Group \#1/Test \#1
ok 1 - Test Suite \#2/Test Group \#1/Test \#1
---
duration_ms: 0.4242
...
# Subtest: Test Suite \#2/Test Group \#1/Test \#2
ok 2 - Test Suite \#2/Test Group \#1/Test \#2
---
duration_ms: 0.0873
...
1..2
ok 1 - Test Group \#1
---
duration_ms: 1.3277
...
# Subtest: Test Group \#2
# Subtest: Test Suite \#2/Test Group \#2/Test \#1
ok 1 - Test Suite \#2/Test Group \#2/Test \#1
---
duration_ms: 0.1065
...
# Subtest: Test Suite \#2/Test Group \#2/Test \#2
ok 2 - Test Suite \#2/Test Group \#2/Test \#2
---
duration_ms: 0.1022
...
1..2
ok 2 - Test Group \#2
---
duration_ms: 0.5298
...
1..2
ok 3 - Test Suite \#2
---
duration_ms: 2.7388
...
# Subtest: Test Suite \#3
# Subtest: Test Suite \#3/Test \#1
ok 1 - Test Suite \#3/Test \#1
---
duration_ms: 0.6406
...
# Subtest: Test Suite \#3/Test \#2
ok 2 - Test Suite \#3/Test \#2
---
duration_ms: 0.147
...
1..2
ok 4 - Test Suite \#3
---
duration_ms: 2.9056
...
1..5
# tests 5
# pass 5
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 1150.6397 It seems like whichever test shows up first is considered the Also..for some reason gitlab seems to use the Here for test suite 3 where it shows 'Test Suite #3/Test#1' is because that's the actual name of the test eg: await t.test('Test Suite #3',async(t) => {
await t.test('Test Suite #3/Test #1', async(tt) => {});
await t.test('Test Suite #3/Test #2', async(tt) => {});
}); I had taken out the I did briefly look into what gets fired on a |
@ForbiddenEra can you please open an issue at https://github.com/MoLow/reporters/tree/main describing what the desired output would be and what node version you are using? |
No problem; I did ask if you would prefer that and will do.. Edit: done - MoLow/reporters#42 thanks again for your time/help/reporter and other work :) |
Trying to use this to convert the
tap
output from the built-in test runner tojunit
for CI/CD use.report.txt (as outputted from
node --test-reporter=tap --test-reporter-destination=report.txt tests/run-tests.js
)Not entirely sure why this is happening but if I had to guess it's nesting depth/recursion related..?
If I take out the
fileSize checks
wrapping around those tests, it seems to work..There's no issues anywhere else, even with the built-in experimental
node
test runner (a previous version of node gave bad output when nesting hit the third level, but onlatest
[v19.8.1
] theTAP
output looks correct to me and is parsed and handled fine by other tools such astap
itself) so I'd rather not lose the 'nice' grouping of the tests just to get ajunit
XML file.The text was updated successfully, but these errors were encountered: