All Projects → hepabolu → Mytap

hepabolu / Mytap

Licence: bsd-3-clause
MySQL Unit Testing Suite

Projects that are alternatives of or similar to Mytap

Blog
Everything about database,business.(Most for PostgreSQL).
Stars: ✭ 6,330 (+5264.41%)
Mutual labels:  plpgsql, database, mysql
Node Mysql Utilities
Query builder for node-mysql with introspection, etc.
Stars: ✭ 98 (-16.95%)
Mutual labels:  database, mysql
Alpine Mariadb
MariaDB running on Alpine Linux [Docker]
Stars: ✭ 117 (-0.85%)
Mutual labels:  database, mysql
Online Shopping System
demo
Stars: ✭ 110 (-6.78%)
Mutual labels:  database, mysql
Zebra database
A compact, lightweight and feature-rich PHP MySQLi database wrapper
Stars: ✭ 98 (-16.95%)
Mutual labels:  database, mysql
Antsdb
AntsDB is a low latency, high concurrency, MySQL compliant SQL layer for HBase
Stars: ✭ 99 (-16.1%)
Mutual labels:  database, mysql
Mysql Haskell
Pure haskell mysql driver
Stars: ✭ 106 (-10.17%)
Mutual labels:  database, mysql
Prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite & MongoDB (Preview)
Stars: ✭ 18,168 (+15296.61%)
Mutual labels:  database, mysql
Next
Directus is a real-time API and App dashboard for managing SQL database content. 🐰
Stars: ✭ 111 (-5.93%)
Mutual labels:  database, mysql
Bible Database
Bible databases as XML, JSON, SQL & SQLITE3 Database format for various languages. Developers can download it freely for their development works. Freely received, freely give.
Stars: ✭ 111 (-5.93%)
Mutual labels:  plpgsql, database
Spring Boot 2 Oauth2 Authorization Jwt
Spring Boot 2 OAuth2 JWT Authorization server implementation with Database for Users and Clients (JPA, Hibernate, MySQL)
Stars: ✭ 115 (-2.54%)
Mutual labels:  database, mysql
Spring Security React Ant Design Polls App
Full Stack Polls App built using Spring Boot, Spring Security, JWT, React, and Ant Design
Stars: ✭ 1,336 (+1032.2%)
Mutual labels:  database, mysql
Go Mygen
Quickly generate CURD and documentation for operating MYSQL.etc
Stars: ✭ 94 (-20.34%)
Mutual labels:  database, mysql
Mycli
A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting.
Stars: ✭ 10,059 (+8424.58%)
Mutual labels:  database, mysql
Qtl
A friendly and lightweight C++ database library for MySQL, PostgreSQL, SQLite and ODBC.
Stars: ✭ 92 (-22.03%)
Mutual labels:  database, mysql
Csv2db
The CSV to database command line loader
Stars: ✭ 102 (-13.56%)
Mutual labels:  database, mysql
Bitnami Docker Mysql
Bitnami MySQL Docker Image
Stars: ✭ 116 (-1.69%)
Mutual labels:  database, mysql
Graphjin
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.
Stars: ✭ 1,264 (+971.19%)
Mutual labels:  database, mysql
Electrocrud
Database CRUD Application Built on Electron | MySQL, Postgres, SQLite
Stars: ✭ 1,267 (+973.73%)
Mutual labels:  database, mysql
Slightphp
SlightPHP 高效的PHP敏捷开发框架
Stars: ✭ 110 (-6.78%)
Mutual labels:  database, mysql

MySQL 5.5 MySQL 5.6 MySQL 5.7 MySQL 8.0 Build Status

MyTAP 1.0

MyTAP is a unit testing framework for MySQL 5.x written using fuctions and procedures. It includes a collection of TAP-emitting assertion functions, as well as the ability to integrate with other TAP-emitting test frameworks.

Installation

To install MyTAP to a MySQL server, just run the install script from the mytap directory:

# ./install.sh

This assumes local server access or user and host credentials in ~/.my.cnf.

The installer will create a database called tap with 2 tables, import the base package and any version specific patches. When installation has completed, the test suite will run automatically. Any errors at this point should be raised as issues because it will likely indicate a change in the MySQL information_schema or a bug in a MySQL release against which myTAP has not been tested.

For installations on remote servers, non-standard port numbers, or where client credentials are not stored, provide the appropriate short or long-form switches for the required parameters. e.g.

# ./install.sh --port 3310
# ./install.sh --user root --password rootpassword 2>/dev/null
# ./install.sh -h 127.0.0.1 -P 3310 --u root --p rootpassword 2>/dev/null

The installer can run a subset of the tests with the --filter option

# ./install.sh --filter table

or, to skip the tests entirely

# ./install.sh --no-tests

Finally, it is also possible to run the installer in test-only mode (useful for developers) with

# ./install.sh --no-install

Short-form versions of all of these switches exist, for full details

# ./install.sh --help

###Amazon Aurora MyTAP may be used on Amazon Aurora but the installation script will generate some errors because Aurora does not permit the use of the SUPER privilege which is necessary to set the MySQL Global variable log_bin_trust_function_creators. It is possibile to work around this issue by creating a new parameter group for your Aurora instance and setting this variable in Edit Parameters within the AWS console. Full instructions on a workaround can be found in this answer on Stack Overflow.

https://stackoverflow.com/a/30874794/5870171

This same issue will cause some errors in running the current version of the test scripts for VIEWS and PRIVILEGS which rely on SUPER privilege to define suitable test data.

MyTAP Test Scripts

Here's an example of how to write a MyTAP test script:

-- Start a transaction.
BEGIN;

-- Plan the tests.
SELECT tap.plan(1);

-- Run the tests.
SELECT tap.pass( 'My test passed, w00t!' );

-- Finish the tests and clean up.
CALL tap.finish();
ROLLBACK;

Note how the TAP test functions are reference from another database so as to keep them separate from your application database.

Now you're ready to run your test script!

% mysql -u root --disable-pager --batch --raw --skip-column-names --unbuffered --database test --execute 'source test.sql'
1..1
ok 1 - My test passed, w00t!

Yeah, that's rather a lot of options to have to remember to get valid tap. I suggest that you install TAP::Parser::SourceHandler::MyTAP instead and just use its my_prove utility:

% my_prove -u root --database test test.sql

Using MyTAP

The purpose of MyTAP is to provide a wide range of testing utilities that output TAP. TAP, or the "Test Anything Protocol", is an emerging standard for representing the output from unit tests. It owes its success to its format as a simple text-based interface that allows for practical machine parsing and high legibility for humans. TAP started life as part of the test harness for Perl but now has implementations in C/C++, Python, PHP, JavaScript, Perl, PostgreSQL, and now MySQL.

More information on the use of MyTAP can be found in the documentation.

To Do

  • Port lot of other assertion functions from pgTAP.

Public Repository

The source code for MyTAP is available on GitHub. Please feel free to fork and contribute!

Authors

Credits

  • Michael Schwern and chromatic for Test::More.
  • Adrian Howard for Test::Exception.

Copyright and License

Copyright (c) 2010 David E. Wheeler, Helma van der Linden. Some rights reserved.

The full license is available in a separate LICENSE file.

minor change to test GitHub connection

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].