feat(build): migrate from Prettier to Oxfmt for performant code formatting (#42434)

This commit is contained in:
Đỗ Trọng Hải
2026-08-04 00:27:05 +07:00
committed by GitHub
parent 10f7927603
commit e4ef84ca72
2328 changed files with 90728 additions and 32682 deletions

View File

@@ -37,26 +37,32 @@ Superset embraces a testing pyramid approach:
## Testing Documentation
### Frontend Testing
- **[Frontend Testing](./frontend-testing.md)** - Jest, React Testing Library, and component testing strategies
### Backend Testing
### Backend Testing
- **[Backend Testing](./backend-testing.md)** - pytest, database testing, and API testing patterns
### End-to-End Testing
- **[E2E Testing](./e2e-testing.md)** - Playwright testing for complete user workflows
### CI/CD Integration
- **[CI/CD](./ci-cd.md)** - Continuous integration, automated testing, and deployment pipelines
## Testing Tools & Frameworks
### Frontend
- **Jest**: JavaScript testing framework for unit and integration tests
- **React Testing Library**: Component testing utilities focused on user behavior
- **Playwright**: Modern end-to-end testing for web applications
- **Storybook**: Component development and visual testing environment
### Backend
- **pytest**: Python testing framework with powerful fixtures and plugins
- **SQLAlchemy Test Utilities**: Database testing and transaction management
- **Flask Test Client**: API endpoint testing and request simulation
@@ -64,12 +70,14 @@ Superset embraces a testing pyramid approach:
## Best Practices
### Writing Effective Tests
1. **Test Behavior, Not Implementation**: Focus on what the code should do, not how it does it
2. **Keep Tests Independent**: Each test should be able to run in isolation
3. **Use Descriptive Names**: Test names should clearly describe what is being tested
4. **Arrange, Act, Assert**: Structure tests with clear setup, execution, and verification phases
### Test Organization
- **Colocation**: Place test files near the code they test
- **Naming Conventions**: Use consistent naming patterns for test files and functions
- **Test Categories**: Organize tests by type (unit, integration, e2e)
@@ -78,11 +86,12 @@ Superset embraces a testing pyramid approach:
## Running Tests
### Quick Commands
```bash
# Frontend unit tests
npm run test
# Backend unit tests
# Backend unit tests
pytest tests/unit_tests/
# End-to-end tests
@@ -93,6 +102,7 @@ npm run test:coverage
```
### Test Development Workflow
1. **Write Failing Test**: Start with a test that describes the desired behavior
2. **Implement Feature**: Write the minimum code to make the test pass
3. **Refactor**: Improve code quality while keeping tests green
@@ -101,11 +111,13 @@ npm run test:coverage
## Testing in Development
### Test-Driven Development (TDD)
- Write tests before implementation
- Use tests to guide design decisions
- Maintain fast feedback loops
### Continuous Testing
- Run tests automatically on code changes
- Integrate testing into development workflow
- Use pre-commit hooks for test validation
@@ -133,18 +145,21 @@ npm run test:coverage
## Testing Levels
### Unit Testing
- **Component testing** - Individual React components
- **Function testing** - Data transformation and utility functions
- **Hook testing** - Custom React hooks
- **Service testing** - API clients and business logic
### Integration Testing
- **API integration** - Backend service communication
- **Component integration** - Multi-component workflows
- **Data flow testing** - End-to-end data processing
- **Plugin lifecycle testing** - Installation and activation
### End-to-End Testing
- **User workflow testing** - Complete user journeys
- **Cross-browser testing** - Browser compatibility
- **Performance testing** - Load and stress testing
@@ -159,4 +174,4 @@ npm run test:coverage
---
*This documentation is under active development. Check back soon for updates!*
_This documentation is under active development. Check back soon for updates!_