Skip to content

Commit

Permalink
fix: update sharded vitest yml
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelangarano committed Nov 27, 2024
1 parent 0dff4a5 commit 2dc37b5
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/sharded-vitest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ jobs:
run: npx vitest --run --shard=${{ matrix.shard }}/${{ matrix.total-shards }} vitest-sharded-example/tests/** --reporter=junit --outputFile=./vitest-sharded-example/results-${{ matrix.shard }}.xml

- name: Combine Vitest Sharded results
run: node ./scripts/combine-results.js --reports-dir vitest-sharded-example --output-file vitest-sharded-example/combined-results.xml
run: node ./scripts/combine-results.js --reports-dir vitest-sharded-example --output-file vitest-sharded-example/currents.results.xml

- name: Generate Instance files
run: node scripts/junitXmlToInstanceJson.js --input vitest-sharded-example/currents.results.xml --output vitest-sharded-example/instances

- name: Report Vitest Sharded results
env:
Expand Down
12 changes: 3 additions & 9 deletions vitest-sharded-example/config.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"framework": "junit",
"frameworkVersion": "2.1.5",
"cliArgs": {
"options": { "jUnitFile": "vitest-sharded-example/combined-results.xml" },
"args": []
},
"frameworkConfig": {
"originFramework": "vitest",
"originFrameworkVersion": "2.1.5"
}
"frameworkVersion": null,
"cliArgs": {},
"frameworkConfig": { "originFramework": "vitest" }
}
34 changes: 34 additions & 0 deletions vitest-sharded-example/currents.results.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<testsuites>
<testsuite name="vitest-sharded-example/tests/stringUtils.spec.js" timestamp="2024-11-27T15:31:38.685Z" hostname="Miguels-Laptop.local" tests="6" failures="2" errors="0" skipped="0" time="0.0070791655">
<testcase classname="vitest-sharded-example/tests/stringUtils.spec.js" name="capitalizeWords > capitalizes first letter of each word" time="0.0013899584"/>
<testcase classname="vitest-sharded-example/tests/stringUtils.spec.js" name="capitalizeWords > handles already capitalized words" time="0.0001815844"/>
<testcase classname="vitest-sharded-example/tests/stringUtils.spec.js" name="capitalizeWords > handles empty string" time="0.0000715828"/>
<testcase classname="vitest-sharded-example/tests/stringUtils.spec.js" name="capitalizeWords > handles single word" time="0.0000698757"/>
<testcase classname="vitest-sharded-example/tests/stringUtils.spec.js" name="capitalizeWords > handles mixed case input" time="0.0040080833">
<failure message="expected 'Hello World' to be 'Hello World!' // Object.is equality" type="AssertionError">
AssertionError: expected 'Hello World' to be 'Hello World!' // Object.is equality

Expected: "Hello World!"
Received: "Hello World"

❯ vitest-sharded-example/tests/stringUtils.spec.js:22:44
</failure>
</testcase>
<testcase classname="vitest-sharded-example/tests/stringUtils.spec.js" name="capitalizeWords > errors on number received" time="0.0005920839">
<failure message="str.split is not a function" type="TypeError">
TypeError: str.split is not a function
❯ Module.capitalizeWords vitest-sharded-example/stringUtils.js:4:6
❯ vitest-sharded-example/tests/stringUtils.spec.js:26:12
</failure>
</testcase>
</testsuite>
<testsuite name="vitest-sharded-example/tests/numberUtils.spec.js" timestamp="2024-11-27T15:31:39.294Z" hostname="Miguels-Laptop.local" tests="6" failures="0" errors="0" skipped="0" time="0.002043541">
<testcase classname="vitest-sharded-example/tests/numberUtils.spec.js" name="calculateAverage > calculates average of positive numbers" time="0.0008744173"/>
<testcase classname="vitest-sharded-example/tests/numberUtils.spec.js" name="calculateAverage > handles array with single number" time="0.0001640005"/>
<testcase classname="vitest-sharded-example/tests/numberUtils.spec.js" name="calculateAverage > handles empty array" time="0.0000665836"/>
<testcase classname="vitest-sharded-example/tests/numberUtils.spec.js" name="calculateAverage > handles negative numbers" time="0.0000643749"/>
<testcase classname="vitest-sharded-example/tests/numberUtils.spec.js" name="calculateAverage > handles decimal numbers" time="0.0001732502"/>
<testcase classname="vitest-sharded-example/tests/numberUtils.spec.js" name="calculateAverage > returns 0 for invalid input" time="0.0000663748"/>
</testsuite>
</testsuites>

0 comments on commit 2dc37b5

Please sign in to comment.