Skip to content

Commit 23fa1c3

Browse files
authored
test: add integration tests for testing end to end workflow (#153)
1 parent aaa7485 commit 23fa1c3

File tree

5 files changed

+32
-5
lines changed

5 files changed

+32
-5
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Integration Test
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
build:
11+
runs-on: macos-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Upload dSYMs to Datadog
18+
uses: DataDog/upload-dsyms-github-action@main
19+
with:
20+
api_key: ${{ secrets.DATADOG_API_KEY }}
21+
site: datadoghq.com
22+
dsym_paths: |
23+
src/__tests__/fixtures/test.zip

dist/index.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/__tests__/main.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('Github Action', () => {
5757
return ''
5858
})
5959
jest.spyOn(core, 'getMultilineInput').mockImplementation(() => ['foo', 'bar'])
60-
jest.spyOn(core, 'getBooleanInput').mockImplementation(() => dry_run)
60+
jest.spyOn(core, 'getInput').mockImplementation(() => (dry_run ? 'true' : 'false'))
6161
const uploadMock = jest.spyOn(action, 'upload').mockImplementation(async () => Promise.resolve(0))
6262

6363
// When
@@ -83,7 +83,7 @@ describe('Github Action', () => {
8383

8484
test('dry run', async () => {
8585
// Given
86-
jest.spyOn(core, 'getBooleanInput').mockImplementation(() => true)
86+
jest.spyOn(core, 'getInput').mockImplementation(() => 'true')
8787
const runMock = jest.spyOn(action.cli, 'run').mockImplementation(async () => Promise.resolve(0))
8888

8989
// When

src/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ export const main = async (): Promise<void> => {
4040
}
4141

4242
const paths = core.getMultilineInput('dsym_paths', {required: true})
43-
const dry_run = core.getBooleanInput('dry_run')
43+
// https://github.com/actions/toolkit/issues/844
44+
// Can't use core.getBooleanInput() because it breaks when input is not set.
45+
const dry_run = core.getInput('dry_run', {required: false}).toLowerCase() === 'true'
4446

4547
for (const path of paths) {
4648
await upload(path, dry_run, context)

0 commit comments

Comments
 (0)