Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
09d6218
fix: handle unexpected event types in publish workflow and update tes…
0xdps Nov 18, 2025
3990370
chore: rename homebrew tap from fakestack to packages
0xdps Nov 18, 2025
91ef518
feat: add uninstall script for removing fakestack from npm, pip, and …
0xdps Nov 18, 2025
d82b8ca
feat: update documentation configuration to include mike for deployment
0xdps Nov 18, 2025
b3d2eac
feat: add support for MariaDB, MS SQL Server, and CockroachDB
0xdps Nov 18, 2025
0ad5158
feat: enhance manual testing workflow for databases with individual t…
0xdps Nov 18, 2025
9d4d380
fix: update sqlcmd path for MS SQL Server verification step in test w…
0xdps Nov 18, 2025
0adab0d
fix: update sqlcmd path for MS SQL Server setup in test workflow
0xdps Nov 18, 2025
cc92e5f
feat: add SQL Server compatibility for table creation, dropping, and …
0xdps Nov 18, 2025
2839070
fix: update SQL parameter placeholders for SQL Server and PostgreSQL …
0xdps Nov 18, 2025
78249ab
Add schema generator script for multiple database types and templates
0xdps Nov 18, 2025
fd10f87
fix: add GO_*.md to .gitignore to exclude Go documentation files
0xdps Nov 18, 2025
3d21c29
feat: update test-databases.yml to use comprehensive_test table with …
0xdps Nov 18, 2025
ae793d0
feat: add template generator for custom data patterns with modifiers …
0xdps Nov 18, 2025
d576599
feat: expand data generation capabilities with 80+ new generators acr…
0xdps Nov 18, 2025
19324eb
Add centralized test schema and workflow documentation
0xdps Nov 18, 2025
b6de805
feat: enhance centralized test schema with comprehensive validation a…
0xdps Nov 18, 2025
8e8758e
fix: resolve database test failures
0xdps Nov 18, 2025
2719045
fix: correct MSSQL password in test schema to match service configura…
0xdps Nov 18, 2025
144baa9
Merge fix-reports into develop
0xdps Nov 18, 2025
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
64 changes: 64 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Test Database Workflows

## Centralized Test Schema

The database integration tests use a centralized schema to ensure consistency across all supported databases.

### Schema File

**`test-schema.json`** - Contains the complete test schema with:
- **84 columns** covering all generator types
- **83 generator fields** (excluding auto-increment ID)
- All categories: Personal, Location, Network, Financial, Time, Localization, Product, Files, Media, Animals, Food, Vehicles, Identifiers, Text, and App data

### How It Works

Each database test job:
1. Merges the centralized schema with database-specific configuration using `jq`
2. Validates that exactly 83 generator fields are present
3. Creates and populates the test table
4. Verifies the row count

### Benefits

✅ **Single Source of Truth** - All generator fields defined once
✅ **Consistency** - Same tests across all 6 databases
✅ **Easy Updates** - Add new generators in one place
✅ **Validation** - Automatic field count verification
✅ **Reduced Duplication** - 71 lines vs 569 lines per database

### Supported Databases

1. **MySQL** 8.0
2. **MariaDB** 10.11
3. **PostgreSQL** 14
4. **SQLite** 3.x
5. **MS SQL Server** 2022
6. **CockroachDB** Latest

### Adding New Generators

To add a new generator to all database tests:

1. Add the column to `test-schema.json` in the `tables[0].columns` array
2. Add the generator field to `test-schema.json` in the `populate[0].fields` array
3. Update the field count validation in `test-databases.yml` (increment the `83` in all 6 tests)

Example:
```json
// In tables[0].columns:
{"name": "new_field", "type": {"name": "string", "args": {"length": 50}}}

// In populate[0].fields:
{"name": "new_field", "generator": "new_generator"}
```

### Schema Validation

Each test automatically validates:
```bash
FIELD_COUNT=$(jq '.populate[0].fields | length' test-schema.json)
[ "$FIELD_COUNT" -eq 83 ] || (echo "❌ Expected 83 fields, got $FIELD_COUNT" && exit 1)
```

This ensures no fields are accidentally omitted during schema merging.
16 changes: 10 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ jobs:
if [ "${{ github.event_name }}" = "push" ]; then
REF="${{ github.ref }}"
TAG_VERSION="${REF#refs/tags/}"
else
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG_VERSION="${{ inputs.tag }}"
else
echo "❌ Unexpected event type: ${{ github.event_name }}"
exit 1
fi

VERSION=$(echo "$TAG_VERSION" | sed 's/^v//')
Expand Down Expand Up @@ -408,7 +411,8 @@ jobs:

### Homebrew (macOS/Linux)
```bash
brew install 0xdps/tap/fakestack
brew tap 0xdps/packages
brew install fakestack
```

### Go
Expand Down Expand Up @@ -469,9 +473,9 @@ jobs:
echo "linux_arm64=$(sha256sum binaries/fakestack-linux-arm64 | awk '{print $1}')" >> $GITHUB_OUTPUT
echo "linux_amd64=$(sha256sum binaries/fakestack-linux-amd64 | awk '{print $1}')" >> $GITHUB_OUTPUT

- name: Clone homebrew-fakestack tap
- name: Clone homebrew-packages tap
run: |
git clone https://github.com/0xdps/homebrew-fakestack.git tap
git clone https://github.com/0xdps/homebrew-packages.git tap

- name: Update Homebrew formula
run: |
Expand All @@ -494,11 +498,11 @@ jobs:

cat tap/Formula/fakestack.rb

- name: Push to homebrew-fakestack tap
- name: Push to homebrew-packages tap
working-directory: tap
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Formula/fakestack.rb
git commit -m "chore: update formula to ${GITHUB_REF#refs/tags/}"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/0xdps/homebrew-fakestack.git main || echo "⚠️ Formula update failed, manual update needed"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/0xdps/homebrew-packages.git trunk || echo "⚠️ Formula update failed, manual update needed"
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

The git push command references trunk branch, but the original repository structure used main. This inconsistency could cause the Homebrew formula update to fail if the target repository doesn't have a trunk branch.

Verify that the homebrew-packages repository uses trunk as its default branch, or update this to match the actual branch name used in that repository.

Suggested change
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/0xdps/homebrew-packages.git trunk || echo "⚠️ Formula update failed, manual update needed"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/0xdps/homebrew-packages.git main || echo "⚠️ Formula update failed, manual update needed"

Copilot uses AI. Check for mistakes.
2 changes: 2 additions & 0 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Build & Test
on:
push:
branches: [ trunk, develop ]
tags:
- 'v*'
paths-ignore:
- '**.md'
- 'docs/**'
Expand Down
Loading
Loading