Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(#252): db in local -> to handle concurrency potential issues #270

Merged
merged 92 commits into from
Jun 17, 2024

Conversation

CinquinAndy
Copy link
Member

No description provided.

@CinquinAndy CinquinAndy self-assigned this Jun 11, 2024
@CinquinAndy CinquinAndy added this to the mvp milestone Jun 11, 2024
@CinquinAndy CinquinAndy added feature New feature or request tests Tests related labels Jun 11, 2024
@CinquinAndy CinquinAndy linked an issue Jun 11, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Jun 11, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 13.63% 1119 / 8209
🔵 Statements 13.63% 1119 / 8209
🔵 Functions 35.53% 43 / 121
🔵 Branches 59.3% 153 / 258
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
check-db-connection.js 0% 0% 0% 0% 1-18
playwright.config.js 0% 0% 0% 0% 1-29
prisma/seed.js 0% 0% 0% 0% 1-464
src/components/usage/usageChart.component.js 0% 0% 0% 0% 1-266
Generated in workflow #276

@CinquinAndy CinquinAndy removed the request for review from LightInn June 11, 2024 15:11
@CinquinAndy CinquinAndy force-pushed the feat/#252-local-pg branch 2 times, most recently from 0e1d6c7 to 3aac79d Compare June 13, 2024 07:48
@CinquinAndy
Copy link
Member Author

j'ai eu envie de crever 123 fois @LightInn
Tu peux regarder, à voir ce que tu veux que je fasse du coup, si ça te vas ou pas :d

Copy link
Contributor

@LightInn LightInn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai longtemps reflechis et malgres qu'il y est des choses qui ne me plaises pas dans les modif de la ci, en vrais osef, ca marche et ce serais couillons de perdre plus de temps avec ca;
Je te propose de merger ca, je ferait des refacto si vraiment je n'arrive pas a mis faire et que j'ai la foie, mais pour le coup, je sais que tu a galerer, donc a un moment donné : It Just Work

Changed environment variable names and updated package.json with new dependencies.
Added a rule to ignore environment files in the repository. This prevents them from being tracked by Git.
Added new subscription data and removed unnecessary comments in the code.
Added detailed usage data for describe API in the seed file.
Refactor user data creation to include createdAt and updatedAt timestamps for each user.
Added functionality to create plans, subscriptions, and usage data during seeding process.
- Added environment variable for TEST_DB_PASSWORD in workflow
- Configured Dockerfile to set POSTGRES_PASSWORD for test-db stage
Adjustments made to the test database setup in the workflow file to include a specific database name and port for better configuration.
Adjusted environment variable settings for database URL in workflow to ensure proper configuration and execution of tasks.
- Refactored test database setup in workflow
- Simplified PostgreSQL installation in Dockerfile
Added arguments and environment variables for DATABASE_URL and TEST_DB_PASSWORD in the Dockerfile to enhance configuration flexibility.
CinquinAndy and others added 27 commits June 17, 2024 10:45
Added a script to check the database connection using Prisma client. The script connects to the database and logs success or failure messages accordingly.
Imported fs and path modules to log client-side console messages to a file. Created a function to capture and write console logs to a text file, attaching it as an artifact.
Added logClient function to enhance test logging capabilities in multiple test files. Now, tests can utilize logClient along with log for improved logging during test execution.
Added the winston logging library to the project dependencies in package.json.
Added step to upload test artifacts to improve testing process.
Added an HTML reporter for test results and enabled verbose console logging in the Playwright configuration file.
- Added new packages '@colors/[email protected]', '@dabh/[email protected]', '[email protected]'
- Updated versions for existing packages
- Updated package resolutions and engine requirements
Added logging functionality using Winston library to create a logger with custom formatting. Updated the log file path in the test helper function to match the new combined-logs.txt location.
- Added artifact upload for combined logs
- Updated database service with logging functionality
Deleted the logger dependency in the database service to improve modularity and reduce coupling.
Removed unnecessary logging statement from the getPlans function to improve code clarity and maintainability.
Add console.info to log plans before returning them.
Simplified the logClient function in tests-helpers to only handle client-side logs, removing file writing and attachment logic.
Changed the conditions for uploading artifacts in the workflow. Removed uploading combined logs and failed test videos based on failure status.
Removed unnecessary console log statement from the code.
Added multiple entries to the usage data array with updated current and previous credit values for each entry.
Changed the headless setting from false to true for improved testing.
Increased timeout values from 30s to 50s for 'general' and 'subscribed' tests. Modified click action to include { force: true } option in 'app-playground.spec.js'.
Added previous and current credit values for each usage entry in the code. This change ensures accurate tracking of credit changes over time.
Include prisma:seed command after prisma:migrate in the workflow.
Added a new script to seed the database using Prisma.
Include a new script under "prisma" for seeding data using prisma/seed.js.
Changed the Prisma seed script in package.json to run using the 'node' command for better execution.
- Updated scripts in package.json for various tasks.
- Updated dependencies in package.json.
- Changed Playwright config to run in non-headless mode.
- Removed a console.info statement from database service.
…-hook-form

Bumped up the versions of @lemonsqueezy/lemonsqueezy.js to 3.2.0 and react-hook-form to 7.52.0 in package.json for compatibility and feature enhancements.
@CinquinAndy CinquinAndy merged commit b088167 into main Jun 17, 2024
1 of 2 checks passed
@CinquinAndy CinquinAndy deleted the feat/#252-local-pg branch June 17, 2024 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request tests Tests related
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

db in local -> to handle concurrency potential issues
2 participants