mirror of
https://github.com/DeNNiiInc/Web-Page-Performance-Test.git
synced 2026-04-17 20:05:58 +00:00
chore: remove db credentials from tracking and add template file
This commit is contained in:
11
lib/db-config.template.js
Normal file
11
lib/db-config.template.js
Normal file
@@ -0,0 +1,11 @@
|
||||
// Database Configuration Template
|
||||
// Copy this file to lib/db-config.js and update with your actual credentials
|
||||
// NEVER commit lib/db-config.js to Git - it's in .gitignore for security
|
||||
|
||||
module.exports = {
|
||||
host: 'YOUR_DATABASE_HOST', // e.g., 'localhost' or '172.16.69.219'
|
||||
user: 'YOUR_DATABASE_USER', // e.g., 'postgres'
|
||||
password: 'YOUR_DATABASE_PASSWORD', // Database password
|
||||
database: 'YOUR_DATABASE_NAME', // e.g., 'webperformance'
|
||||
port: 5432, // Default PostgreSQL port
|
||||
};
|
||||
@@ -264,10 +264,13 @@ async function _executeTest(url, options) {
|
||||
];
|
||||
|
||||
try {
|
||||
console.log('📝 Attempting DB Insert for Test:', testId);
|
||||
console.log('👤 User UUID:', options.userUuid);
|
||||
const db = require('../lib/db');
|
||||
await db.pool.query(insertQuery, values);
|
||||
console.log('✅ DB Insert Success!');
|
||||
} catch (dbErr) {
|
||||
console.error('Failed to save result to DB:', dbErr);
|
||||
console.error('❌ Failed to save result to DB:', dbErr);
|
||||
// Don't fail the whole test if DB save fails, just log it
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user