Skip to content

Commit

Permalink
test: with fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
willgeorgetaylor committed Dec 28, 2023
1 parent 69fbf37 commit 49b0155
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ jobs:

- name: Test Local Action
uses: ./
with:
include: ./fixtures/*.xml
11 changes: 11 additions & 0 deletions fixtures/Sample.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="Admin::Jobs::Applications::Actions::CreativeServicesIncBackgroundCheckTest" filepath="test/system/admin/jobs/applications/actions/creative_services_inc_background_check_test.rb" skipped="0" failures="0" errors="0" tests="2" assertions="14" time="29.099594811999992">
<testcase name="test_should_show_each_of_the_different_values_depending_on_which_billing_option_you_select" lineno="90" classname="Admin::Jobs::Applications::Actions::CreativeServicesIncBackgroundCheckTest" assertions="0" time="15.373165432000008" file="test/system/admin/jobs/applications/actions/creative_services_inc_background_check_test.rb">
</testcase>
<testcase name="test_should_not_be_able_to_view_a_background_check_without_background_check_viewer_role" lineno="176" classname="Admin::Jobs::Applications::Actions::CreativeServicesIncBackgroundCheckTest" assertions="2" time="6.697016684999994" file="test/system/admin/jobs/applications/actions/creative_services_inc_background_check_test.rb">
</testcase>
<testcase name="test_should_not_see_Creative_Services_Inc_integration_when_removed" lineno="53" classname="Admin::Jobs::Applications::Actions::CreativeServicesIncBackgroundCheckTest" assertions="1" time="7.1485544199999822" file="test/system/admin/jobs/applications/actions/creative_services_inc_background_check_test.rb">
</testcase>
</testsuite>
</testsuites>
11 changes: 11 additions & 0 deletions fixtures/Sample2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="Admin::Jobs::Applications::Actions::CreativeServicesIncBackgroundCheckTest" filepath="test/system/admin/jobs/applications/actions/creative_services_inc_background_check_test.rb" skipped="0" failures="0" errors="0" tests="7" assertions="20" time="69.099594811999992">
<testcase name="test_should_show_each_of_the_different_values_depending_on_which_billing_option_you_select" lineno="90" classname="Admin::Jobs::Applications::Actions::CreativeServicesIncBackgroundCheckTest" assertions="0" time="10.373165432000008" file="test/system/admin/jobs/applications/actions/creative_services_inc_background_check_test.rb">
</testcase>
<testcase name="test_should_not_be_able_to_view_a_background_check_without_background_check_viewer_role" lineno="176" classname="Admin::Jobs::Applications::Actions::CreativeServicesIncBackgroundCheckTest" assertions="2" time="2.697016684999994" file="test/system/admin/jobs/applications/actions/creative_services_inc_background_check_test.rb">
</testcase>
<testcase name="test_should_not_see_Creative_Services_Inc_integration_when_removed" lineno="53" classname="Admin::Jobs::Applications::Actions::CreativeServicesIncBackgroundCheckTest" assertions="1" time="2.697016684999994" file="test/system/admin/jobs/applications/actions/creative_services_inc_background_check_test.rb">
</testcase>
</testsuite>
</testsuites>
18 changes: 3 additions & 15 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,11 @@ export async function run(): Promise<void> {
([key, value]) => `${key}=${value}`
)

let stdout = ''
let stderr = ''
core.info(`Running junit-reducer with arguments: `)
core.info(Object.entries(inputs).map(([key, value]) => `${key}: ${value}`).join('\n'))

core.info(`Running junit-reducer with arguments: ${args}`)
await exec.exec('junit-reducer', args, {
listeners: {
stdout: data => {
stdout += data.toString()
},
stderr: data => {
stderr += data.toString()
}
}
})
await exec.exec('junit-reducer', args)

core.info(`junit-reducer stdout:\n${stdout}`)
core.info(`junit-reducer stderr:\n${stderr}`)
} catch (error) {
// Fail the workflow run if an error occurs
if (error instanceof Error) core.setFailed(error.message)
Expand Down

0 comments on commit 49b0155

Please sign in to comment.