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

test(sound): check sound files in rust tests #282

Merged
merged 1 commit into from
Nov 14, 2024
Merged

Conversation

fouge
Copy link
Collaborator

@fouge fouge commented Oct 28, 2024

instead of invoking soxi
check that all files are present in the assets
check bits per sample (16 bits)
SOUNDS_DIR can be overwritten at runtime with an env variable tests are run with all other rust tests

@fouge fouge force-pushed the fouge/sound-files branch 4 times, most recently from 0e96adf to c742f22 Compare October 28, 2024 12:37
@fouge fouge requested a review from TheButlah October 28, 2024 12:38
@@ -148,8 +149,8 @@ jobs:
cat ${GITHUB_ENV}
- name: Cargo Test
run: |
nix develop -c \
cargo test --all --all-features --all-targets $EXCLUDES
SOUNDS_DIR=$(pwd)/ui/sound/assets nix develop -c \
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't like setting this variable here but i didn't find a better approach :/

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets use a config struct rather than this global env var

@@ -148,8 +149,8 @@ jobs:
cat ${GITHUB_ENV}
- name: Cargo Test
run: |
nix develop -c \
cargo test --all --all-features --all-targets $EXCLUDES
SOUNDS_DIR=$(pwd)/ui/sound/assets nix develop -c \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets use a config struct rather than this global env var

@fouge fouge force-pushed the fouge/sound-files branch 3 times, most recently from 4efdcd4 to ae17f2c Compare November 14, 2024 15:30
use std::time::Duration;

struct MockJetson {
sound_files: Arc<DashMap<Type, SoundFile>>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need a DashMap when we aren't mutating this variable?

instead of invoking soxi
check that all files are present in the assets
check bits per sample (16 bits)
sounds directory based on cargo manifest path for tests.
tests are run with all other rust tests
@fouge fouge enabled auto-merge (squash) November 14, 2024 15:46
@fouge fouge merged commit e4c8de1 into main Nov 14, 2024
10 checks passed
@fouge fouge deleted the fouge/sound-files branch November 14, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants