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

Just testing ignore this #55

Merged
merged 19 commits into from
Feb 27, 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
4 changes: 4 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Pull Request

on:
push:
branches: ['ci-test/*']
pull_request:
branches: '*'

Expand All @@ -11,5 +13,7 @@ jobs:

trigger-unit-test:
name: Run Unit Tests
permissions:
pull-requests: write
uses: ./.github/workflows/unit-test.yml
secrets: inherit
57 changes: 47 additions & 10 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,36 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
with:
files_yaml: |
auth:
- 'packages/auth/**'
common:
- 'packages/common/**'
event-producer:
- 'packages/event-producer/**'
player:
- 'packages/player/**'
player-web-components:
- 'packages/player-web-components/**'
template:
- 'packages/template/**'
true-time:
- 'packages/true-time/**'
# Optionally set `files_yaml_from_source_file` to read the YAML from a file. e.g `files_yaml_from_source_file: .github/changed-files.yml`

- name: Run step if test file(s) change
# NOTE: Ensure all outputs are prefixed by the same key used above e.g. `test_(...)` | `doc_(...)` | `src_(...)` when trying to access the `any_changed` output.
if: steps.changed-files.outputs.any_changed == 'true'
env:
TEST_ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.any_changed_files }}
run: |
echo "One or more test file(s) has changed."
echo "List all the files that have changed: $TEST_ALL_CHANGED_FILES"

- name: Prepare test user for player tests
id: json
run: |
Expand All @@ -26,36 +56,43 @@ jobs:
TEST_USER: ${{ secrets.PLAYER_TEST_USER }}
- name: Run Tests
run: |
echo "Running tests for ${{ inputs.modules }}"
pnpm test:coverage
env:
TEST_USER: ${{ steps.json.outputs.encoded }}
- name: Report Auth Coverage
if: always()
if: steps.changed-files.outputs.auth_any_changed
uses: davelosert/vitest-coverage-report-action@v2
with:
name: 'Auth'
working-directory: './packages/auth'
working-directory: 'packages/auth'
- name: Report Common Coverage
if: always()
if: steps.changed-files.outputs.common_any_changed
uses: davelosert/vitest-coverage-report-action@v2
with:
name: 'Common'
working-directory: './packages/common'
working-directory: 'packages/common'
- name: Report Event-Producer Coverage
if: always()
if: steps.changed-files.outputs.event-producer_any_changed
uses: davelosert/vitest-coverage-report-action@v2
with:
name: 'Event Producer'
working-directory: './packages/event-producer'
working-directory: 'packages/event-producer'
- name: Report Player-Web-Components Coverage
if: always()
if: steps.changed-files.outputs.player-web-components_any_changed
uses: davelosert/vitest-coverage-report-action@v2
with:
name: 'Player Web Components'
working-directory: './packages/player-web-components'
working-directory: 'packages/player-web-components'
- name: Report Template Coverage
if: steps.changed-files.outputs.template_any_changed
uses: davelosert/vitest-coverage-report-action@v2
with:
name: 'Template'
working-directory: 'packages/template'
- name: Report True-Time Coverage
if: always()
if: steps.changed-files.outputs.true-time_any_changed
uses: davelosert/vitest-coverage-report-action@v2
with:
name: 'True Time'
working-directory: './packages/true-time'
working-directory: 'packages/true-time'
2 changes: 2 additions & 0 deletions packages/common/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* v8 ignore start */
export * from './illegalArgumentError';
export * from './networkError';
export * from './retryableError';
export * from './tidalError';
export * from './tidalMessage';
export * from './credentialsProvider';
/* v8 ignore stop */
6 changes: 6 additions & 0 deletions packages/event-producer/src/bus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ export const postMessage = (message: OutageStartError | TidalMessage) => {
});
globalThis.dispatchEvent(event);
};

// @ts-expect-error this is for testing ci only
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const someLegacyCode = () => {
console.error('please delete me');
};
Loading