mirror of
https://github.com/apache/superset.git
synced 2026-04-18 15:44:57 +00:00
feat(docs): Populate Developer Portal with comprehensive documentation framework (#35217)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
68
docs/developer_portal/testing/backend-testing.md
Normal file
68
docs/developer_portal/testing/backend-testing.md
Normal file
@@ -0,0 +1,68 @@
|
||||
---
|
||||
title: Backend Testing
|
||||
sidebar_position: 3
|
||||
---
|
||||
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
# Backend Testing
|
||||
|
||||
🚧 **Coming Soon** 🚧
|
||||
|
||||
Complete guide for testing Superset's Python backend, APIs, and database interactions.
|
||||
|
||||
## Topics to be covered:
|
||||
|
||||
- Pytest configuration and fixtures
|
||||
- Unit testing best practices
|
||||
- Integration testing with databases
|
||||
- API endpoint testing
|
||||
- Mocking strategies and patterns
|
||||
- Testing async operations with Celery
|
||||
- Security testing guidelines
|
||||
- Performance and load testing
|
||||
- Test database setup and teardown
|
||||
- Coverage requirements
|
||||
|
||||
## Quick Commands
|
||||
|
||||
```bash
|
||||
# Run all backend tests
|
||||
pytest
|
||||
|
||||
# Run specific test file
|
||||
pytest tests/unit_tests/specific_test.py
|
||||
|
||||
# Run with coverage
|
||||
pytest --cov=superset
|
||||
|
||||
# Run tests in parallel
|
||||
pytest -n auto
|
||||
|
||||
# Run only unit tests
|
||||
pytest tests/unit_tests/
|
||||
|
||||
# Run only integration tests
|
||||
pytest tests/integration_tests/
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
*This documentation is under active development. Check back soon for updates!*
|
||||
70
docs/developer_portal/testing/ci-cd.md
Normal file
70
docs/developer_portal/testing/ci-cd.md
Normal file
@@ -0,0 +1,70 @@
|
||||
---
|
||||
title: CI/CD and Automation
|
||||
sidebar_position: 5
|
||||
---
|
||||
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
# CI/CD and Automation
|
||||
|
||||
🚧 **Coming Soon** 🚧
|
||||
|
||||
Understanding Superset's continuous integration and deployment pipelines.
|
||||
|
||||
## Topics to be covered:
|
||||
|
||||
- GitHub Actions workflows
|
||||
- Pre-commit hooks configuration
|
||||
- Automated testing pipelines
|
||||
- Code quality checks (ESLint, Prettier, Black, MyPy)
|
||||
- Security scanning (Dependabot, CodeQL)
|
||||
- Docker image building and publishing
|
||||
- Release automation
|
||||
- Performance benchmarking
|
||||
- Coverage reporting and tracking
|
||||
|
||||
## Pre-commit Hooks
|
||||
|
||||
```bash
|
||||
# Install pre-commit hooks
|
||||
pre-commit install
|
||||
|
||||
# Run all hooks on staged files
|
||||
pre-commit run
|
||||
|
||||
# Run specific hook
|
||||
pre-commit run mypy
|
||||
|
||||
# Run on all files (not just staged)
|
||||
pre-commit run --all-files
|
||||
```
|
||||
|
||||
## GitHub Actions
|
||||
|
||||
Key workflows:
|
||||
- `test-frontend.yml` - Frontend tests
|
||||
- `test-backend.yml` - Backend tests
|
||||
- `docker.yml` - Docker image builds
|
||||
- `codeql.yml` - Security analysis
|
||||
- `release.yml` - Release automation
|
||||
|
||||
---
|
||||
|
||||
*This documentation is under active development. Check back soon for updates!*
|
||||
80
docs/developer_portal/testing/e2e-testing.md
Normal file
80
docs/developer_portal/testing/e2e-testing.md
Normal file
@@ -0,0 +1,80 @@
|
||||
---
|
||||
title: End-to-End Testing
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
# End-to-End Testing
|
||||
|
||||
🚧 **Coming Soon** 🚧
|
||||
|
||||
Guide for writing and running end-to-end tests using Playwright and Cypress.
|
||||
|
||||
## Topics to be covered:
|
||||
|
||||
### Playwright (Recommended)
|
||||
- Setting up Playwright environment
|
||||
- Writing reliable E2E tests
|
||||
- Page Object Model pattern
|
||||
- Handling async operations
|
||||
- Cross-browser testing
|
||||
- Visual regression testing
|
||||
- Debugging with Playwright Inspector
|
||||
- CI/CD integration
|
||||
|
||||
### Cypress (Deprecated)
|
||||
- Legacy Cypress test maintenance
|
||||
- Migration to Playwright
|
||||
- Running existing Cypress tests
|
||||
|
||||
## Quick Commands
|
||||
|
||||
### Playwright
|
||||
```bash
|
||||
# Run all Playwright tests
|
||||
npm run playwright:test
|
||||
|
||||
# Run in headed mode (see browser)
|
||||
npm run playwright:headed
|
||||
|
||||
# Run specific test file
|
||||
npx playwright test tests/auth/login.spec.ts
|
||||
|
||||
# Debug specific test
|
||||
npm run playwright:debug tests/auth/login.spec.ts
|
||||
|
||||
# Open Playwright UI
|
||||
npm run playwright:ui
|
||||
```
|
||||
|
||||
### Cypress (Deprecated)
|
||||
```bash
|
||||
# Run Cypress tests
|
||||
cd superset-frontend/cypress-base
|
||||
npm run cypress-run-chrome
|
||||
|
||||
# Open Cypress UI
|
||||
npm run cypress-debug
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
*This documentation is under active development. Check back soon for updates!*
|
||||
61
docs/developer_portal/testing/frontend-testing.md
Normal file
61
docs/developer_portal/testing/frontend-testing.md
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
title: Frontend Testing
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
# Frontend Testing
|
||||
|
||||
🚧 **Coming Soon** 🚧
|
||||
|
||||
Comprehensive guide for testing Superset's frontend components and features.
|
||||
|
||||
## Topics to be covered:
|
||||
|
||||
- Jest configuration and setup
|
||||
- React Testing Library best practices
|
||||
- Component testing strategies
|
||||
- Redux store testing
|
||||
- Async operations and API mocking
|
||||
- Snapshot testing guidelines
|
||||
- Coverage requirements and reporting
|
||||
- Debugging test failures
|
||||
- Performance testing for UI components
|
||||
|
||||
## Quick Commands
|
||||
|
||||
```bash
|
||||
# Run all frontend tests
|
||||
npm run test
|
||||
|
||||
# Run tests in watch mode
|
||||
npm run test -- --watch
|
||||
|
||||
# Run tests with coverage
|
||||
npm run test -- --coverage
|
||||
|
||||
# Run specific test file
|
||||
npm run test -- MyComponent.test.tsx
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
*This documentation is under active development. Check back soon for updates!*
|
||||
164
docs/developer_portal/testing/overview.md
Normal file
164
docs/developer_portal/testing/overview.md
Normal file
@@ -0,0 +1,164 @@
|
||||
---
|
||||
title: Testing Overview
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
# Testing Overview
|
||||
|
||||
Apache Superset follows a comprehensive testing strategy that ensures code quality, reliability, and maintainability. This section covers all aspects of testing in the Superset ecosystem, from unit tests to end-to-end testing workflows.
|
||||
|
||||
## Testing Philosophy
|
||||
|
||||
Superset embraces a testing pyramid approach:
|
||||
|
||||
- **Unit Tests**: Fast, isolated tests for individual components and functions
|
||||
- **Integration Tests**: Tests that verify component interactions and API endpoints
|
||||
- **End-to-End Tests**: Full user journey testing in browser environments
|
||||
|
||||
## Testing Documentation
|
||||
|
||||
### Frontend Testing
|
||||
- **[Frontend Testing](./frontend-testing)** - Jest, React Testing Library, and component testing strategies
|
||||
|
||||
### Backend Testing
|
||||
- **[Backend Testing](./backend-testing)** - pytest, database testing, and API testing patterns
|
||||
|
||||
### End-to-End Testing
|
||||
- **[E2E Testing](./e2e-testing)** - Playwright testing for complete user workflows
|
||||
|
||||
### CI/CD Integration
|
||||
- **[CI/CD](./ci-cd)** - 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
|
||||
- **Factory Boy**: Test data generation and model factories
|
||||
|
||||
## 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)
|
||||
- **Test Data Management**: Use factories and fixtures for consistent test data
|
||||
|
||||
## Running Tests
|
||||
|
||||
### Quick Commands
|
||||
```bash
|
||||
# Frontend unit tests
|
||||
npm run test
|
||||
|
||||
# Backend unit tests
|
||||
pytest tests/unit_tests/
|
||||
|
||||
# End-to-end tests
|
||||
npm run playwright:test
|
||||
|
||||
# All tests with coverage
|
||||
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
|
||||
4. **Verify Coverage**: Ensure adequate test coverage for new code
|
||||
|
||||
## 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
|
||||
|
||||
## Getting Started
|
||||
|
||||
1. **Set up Testing Environment**: Follow the development setup guide
|
||||
2. **Run Existing Tests**: Familiarize yourself with the test suite
|
||||
3. **Write Your First Test**: Start with a simple unit test
|
||||
4. **Learn Testing Patterns**: Study existing tests for patterns and conventions
|
||||
|
||||
## Topics to be covered:
|
||||
|
||||
- Testing strategy and pyramid
|
||||
- Test-driven development (TDD) for plugins
|
||||
- Continuous integration and automated testing
|
||||
- Code coverage and quality metrics
|
||||
- Testing tools and frameworks overview
|
||||
- Mock data and test fixtures
|
||||
- Performance testing and benchmarking
|
||||
- Accessibility testing automation
|
||||
- Cross-browser and device testing
|
||||
- Regression testing strategies
|
||||
|
||||
## 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
|
||||
- **Accessibility testing** - Screen reader and keyboard navigation
|
||||
|
||||
## Testing Tools
|
||||
|
||||
- **Jest** - Unit and integration testing framework
|
||||
- **React Testing Library** - Component testing utilities
|
||||
- **Playwright** - End-to-end testing (replacing Cypress)
|
||||
- **Storybook** - Component development and testing
|
||||
- **MSW** - API mocking for testing
|
||||
|
||||
---
|
||||
|
||||
*This documentation is under active development. Check back soon for updates!*
|
||||
Reference in New Issue
Block a user