Testing | db-dumper-go | Spatie       

 SPATIE  

db-dumper-go
============

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Db-dumper-go](https://spatie.be/docs/db-dumper-go/v1)  Testing

 Version   v1      

 Other versions for crawler [v1](https://spatie.be/docs/db-dumper-go/v1) 

  Testing    
- [ Introduction ](https://spatie.be/docs/db-dumper-go/v1/introduction)
- [ Requirements ](https://spatie.be/docs/db-dumper-go/v1/requirements)
- [ Installation and setup ](https://spatie.be/docs/db-dumper-go/v1/installation-and-setup)
- [ Usage ](https://spatie.be/docs/db-dumper-go/v1/usage)
- [ Processes and output ](https://spatie.be/docs/db-dumper-go/v1/processes-and-output)
- [ Testing ](https://spatie.be/docs/db-dumper-go/v1/testing)
- [ Releasing ](https://spatie.be/docs/db-dumper-go/v1/releasing)
- [ Contributing ](https://spatie.be/docs/db-dumper-go/v1/contributing)
- [ Security vulnerabilities ](https://spatie.be/docs/db-dumper-go/v1/security-vulnerabilities)
- [ Credits ](https://spatie.be/docs/db-dumper-go/v1/credits)
- [ License ](https://spatie.be/docs/db-dumper-go/v1/license)
- [ Changelog ](https://spatie.be/docs/db-dumper-go/v1/changelog)
- [ Support us ](https://spatie.be/docs/db-dumper-go/v1/support-us)

 Testing
=======

Run `go test -race ./...` to execute the tests and examples. Run `go vet ./...` for static checks and `go mod tidy -diff` to check dependency metadata. Format code with `gofmt -w .`.

The portable suite checks command arguments, credentials, URL parsing, custom execution/compression, process failures, deadlines, empty/large output and preservation of old backups. SQLite tests dump and restore real tables with include/exclude selection and both compression formats when the executables are installed.

CI also starts disposable MySQL 8.4, MariaDB 11, PostgreSQL 17 and MongoDB 8 services and uses their actual dump and restore binaries. MySQL/MariaDB restore tests verify excluded table data, restored rows and triggers that must not fire while restoring data. These tests drop the `db_dumper_test` and `db_dumper_restored` fixture databases in the named containers. Never aim them at production.

To repeat the server tests locally, start disposable containers named `db-dumper-mysql`, `db-dumper-mariadb`, `db-dumper-postgres` and `db-dumper-mongo`, matching `.github/workflows/ci.yml`. Mount `/tmp:/tmp` so protected temporary credential files are available to container tools. Then run:

```
DB_DUMPER_NATIVE=1 go test -race -count=1 -v -run TestNative ./...
```

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
