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

tests / update #121

Merged
merged 14 commits into from
Dec 20, 2024
Merged

tests / update #121

merged 14 commits into from
Dec 20, 2024

Conversation

felixerdy
Copy link
Member

@felixerdy felixerdy commented Nov 13, 2024

Closes #118

This pull request includes significant updates to the Docker setup, CI workflows, and test configurations. The changes aim to modernize the Docker environment, improve the CI workflow, and enhance the test coverage and reporting.

Dockerfile and Docker Setup Updates:

  • Updated the base image in Dockerfile to node:22-alpine and streamlined environment variable definitions and package installations.
  • Simplified the installation of Arduino libraries by using arduino-cli lib install --git-url instead of downloading and unzipping manually.
  • Removed the Dockerfile.test file, consolidating the test and production stages into a single Dockerfile.

CI Workflow Improvements:

  • Modified .github/workflows/registry-build-publish.yaml to add a target: production parameter for the Docker build action.
  • Updated .github/workflows/test.yml to trigger the workflow only on pull request events for the main branch and added steps to run CTRF annotations. [1] [2]

Testing Enhancements:

  • Added comprehensive test cases using Chai and Mocha, including tests for various endpoints and scenarios in test/index.js, test/mcu.js, and test/mcu_s2.js. [1] [2] [3]
  • Introduced a mocha-reporters.json configuration file to enable multiple reporters for Mocha, including a custom CTRF JSON reporter.
  • Updated package.json to include new dev dependencies for Mocha reporters and increased the test timeout. [1] [2]

Codebase Improvements:

  • Modified the src/index.js to conditionally skip logging in test environments.

These changes collectively enhance the project's maintainability, testing robustness, and CI/CD efficiency.

@mariopesch
Copy link
Member

@felixerdy isn't it bad to use --break-system-packages?

@felixerdy
Copy link
Member Author

@felixerdy isn't it bad to use --break-system-packages?

Not the most elegant way, I agree. Need to check how we can do it without

Copy link

Test Summary - Run #170

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
17 17 0 0 0 0 0 1m6s

🎉 All tests passed!

Github Test Reporter CTRF

Copy link

Test Summary - Run #171

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
17 17 0 0 0 0 0 1m16s

🎉 All tests passed!

Github Test Reporter CTRF

@felixerdy
Copy link
Member Author

Refactored to using node:22-alpine which eliminates the need of --break-system-packages

@felixerdy felixerdy requested review from mpfeil and removed request for mpfeil November 14, 2024 14:35
Copy link

Test Summary - Run #172

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
17 17 0 0 0 0 0 1m17s

🎉 All tests passed!

Github Test Reporter CTRF

@felixerdy felixerdy requested a review from mpfeil November 14, 2024 16:47
Copy link

test: Run #173

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
17 17 0 0 0 0 0 1m16s

🎉 All tests passed!

Github Test Reporter

@felixerdy felixerdy merged commit 6eb4011 into main Dec 20, 2024
2 checks passed
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.

Update Arduino CLI Version
2 participants