mirror of
https://github.com/xbgmsharp/postgsail.git
synced 2025-09-17 11:17:46 +00:00
Compare commits
4 Commits
57a754cdc0
...
883c875e39
Author | SHA1 | Date | |
---|---|---|---|
![]() |
883c875e39 | ||
![]() |
0282823938 | ||
![]() |
4546b75e0d | ||
![]() |
0c28ed6a0f |
@@ -1,5 +1,5 @@
|
|||||||
# PostgSail Unit Tests
|
# PostgSail Unit Tests
|
||||||
The Unit Tests allow to automatically validate api workflow.
|
The Unit Tests allow to automatically validate SQL and API workflow.
|
||||||
|
|
||||||
## A global overview
|
## A global overview
|
||||||
Based on `mocha` & `psql`
|
Based on `mocha` & `psql`
|
||||||
|
@@ -688,7 +688,7 @@ var moment = require("moment");
|
|||||||
should.exist(res.body);
|
should.exist(res.body);
|
||||||
let event = res.body;
|
let event = res.body;
|
||||||
//console.log(event);
|
//console.log(event);
|
||||||
// minimum events log for kapla & aava 13 + 4 email_otp = 17
|
// minimum events log per users 6 + 4 logs + OTP one per login
|
||||||
event.length.should.be.aboveOrEqual(11);
|
event.length.should.be.aboveOrEqual(11);
|
||||||
done(err);
|
done(err);
|
||||||
});
|
});
|
||||||
|
@@ -8,8 +8,5 @@
|
|||||||
"moment": "^2.29.4",
|
"moment": "^2.29.4",
|
||||||
"should": "^13.2.3",
|
"should": "^13.2.3",
|
||||||
"supertest": "^6.3.3"
|
"supertest": "^6.3.3"
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"schemalint": "^2.0.5"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -14,15 +14,6 @@ if [[ ! -x "/usr/bin/psql" ]]; then
|
|||||||
apt update && apt -y install postgresql-client
|
apt update && apt -y install postgresql-client
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# go install
|
|
||||||
if [[ ! -x "/usr/bin/go" || ! -x "/root/go/bin/mermerd" ]]; then
|
|
||||||
#wget -q https://go.dev/dl/go1.21.4.linux-arm64.tar.gz && \
|
|
||||||
#rm -rf /usr/local/go && tar -C /usr/local -xzf go1.21.4.linux-arm64.tar.gz && \
|
|
||||||
apt update && apt -y install golang-go && \
|
|
||||||
#go install github.com/KarnerTh/mermerd@latest require latest go version
|
|
||||||
go install github.com/KarnerTh/mermerd@v0.11.0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# pnpm install
|
# pnpm install
|
||||||
if [[ ! -x "/usr/local/bin/pnpm" ]]; then
|
if [[ ! -x "/usr/local/bin/pnpm" ]]; then
|
||||||
npm install -g pnpm
|
npm install -g pnpm
|
||||||
@@ -231,17 +222,17 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Stats SQL unit tests
|
# Stats SQL unit tests
|
||||||
#psql ${PGSAIL_DB_URI} < sql/stats.sql > output/stats.sql.output
|
psql ${PGSAIL_DB_URI} < sql/stats.sql > output/stats.sql.output
|
||||||
#diff sql/stats.sql.output output/stats.sql.output > /dev/null
|
diff sql/stats.sql.output output/stats.sql.output > /dev/null
|
||||||
#diff -u sql/stats.sql.output output/stats.sql.output | wc -l
|
#diff -u sql/stats.sql.output output/stats.sql.output | wc -l
|
||||||
#echo 0
|
#echo 0
|
||||||
#if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
# echo SQL stats.sql OK
|
echo SQL stats.sql OK
|
||||||
#else
|
else
|
||||||
# echo SQL stats.sql FAILED
|
echo SQL stats.sql FAILED
|
||||||
# diff -u sql/stats.sql.output output/stats.sql.output
|
diff -u sql/stats.sql.output output/stats.sql.output
|
||||||
# exit 1
|
exit 1
|
||||||
#fi
|
fi
|
||||||
|
|
||||||
# MobilityDB SQL unit tests
|
# MobilityDB SQL unit tests
|
||||||
psql ${PGSAIL_DB_URI} < sql/mobilitydb.sql > output/mobilitydb.sql.output
|
psql ${PGSAIL_DB_URI} < sql/mobilitydb.sql > output/mobilitydb.sql.output
|
||||||
@@ -292,17 +283,3 @@ else
|
|||||||
echo openapi.json FAILED
|
echo openapi.json FAILED
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Generate and update mermaid schema documentation
|
|
||||||
/root/go/bin/mermerd --runConfig ../docs/ERD/mermerdConfig.yaml
|
|
||||||
#echo $?
|
|
||||||
echo 0 # not working in github-actions
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
cp postgsail.md ../docs/ERD/postgsail.md
|
|
||||||
echo postgsail.md OK
|
|
||||||
else
|
|
||||||
echo postgsail.md FAILED
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#npm i -D schemalint && npx schemalint
|
|
||||||
|
Reference in New Issue
Block a user