Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
fix: Add a target to generate test date from TM
Browse files Browse the repository at this point in the history
  • Loading branch information
rsavoye committed Dec 17, 2023
1 parent 7af7f7d commit 691f484
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tm_admin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,25 @@ realclean: clean
@$(RM) -f *~ */*~ rm -fr __pycache__/ */rm -fr __pycache__/


# Developer only! This requires a Tasking Manager database running on your local machine.
# This is used to update the test data if any changes to the TM database schema are made.
tmtestdata:
@echo "Generating test data for users table..."
-@ogr2ogr ../tests/tmusers.sql PG:'dbname=tm4' -sql "SELECT * FROM users LIMIT 10"
-@sed -i -e '/ALTER/d' -e '/TABLE/d' -e '/BEGIN/d' tmusers.sql
@echo "Generating test data for projects table..."
-@ogr2ogr ../tests/tmprojects.sql PG:'dbname=tm4' -sql "SELECT * FROM projects LIMIT 10"
-@sed -i -e '/ALTER/d' -e '/TABLE/d' -e '/BEGIN/d' -e '/CREATE/d' ../tests/tmprojects.sql
@echo "Generating test data for organizations table..."
-@ogr2ogr ../tests/tmorganizations.sql PG:'dbname=tm4' -sql "SELECT * FROM organisations LIMIT 10"
-@sed -i -e '/ALTER/d' -e '/TABLE/d' -e '/BEGIN/d' -e '/CREATE/d' ../tests/tmorganizations.sql
@echo "Generating test data for tasks table..."
-@ogr2ogr ../tests/tmtasks.sql PG:'dbname=tm4' -sql "SELECT * FROM tasks LIMIT 10"
-@sed -i -e '/ALTER/d' -e '/TABLE/d' -e '/BEGIN/d' -e '/SELECT/d' -e '/CREATE/d' ../tests/tmtasks.sql
@echo "Generating test data for teams table..."
-@ogr2ogr ../tests/tmteams.sql PG:'dbname=tm4' -sql "SELECT * FROM teams LIMIT 10"
-@sed -i -e '/ALTER/d' -e '/TABLE/d' -e '/BEGIN/d' -e '/SELECT/d' -e '/CREATE/d' ../tests/tmteams.sql

.SUFFIXES: .py .sql .yaml .proto

force:

0 comments on commit 691f484

Please sign in to comment.