Skip to content

GSOC: Add env file merger, e2e test database cleanup, and signup flow test without email verification#4210

Open
clairep94 wants to merge 8 commits into
processing:developfrom
clairep94:clairep-setup_test_db_e2e
Open

GSOC: Add env file merger, e2e test database cleanup, and signup flow test without email verification#4210
clairep94 wants to merge 8 commits into
processing:developfrom
clairep94:clairep-setup_test_db_e2e

Conversation

@clairep94

@clairep94 clairep94 commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Issue:

Fixes #
GSOC E2E test setup -- configures a way to have separate e2e ENV variables, test db and server

Demo:

Screen.Recording.2026-07-18.at.21.30.30.mov

When an e2e app server has not been started from another terminal you see this warning:

Screenshot 2026-07-18 at 22 39 03

Changes:

  • Adds a loadEnv.js function which helps merge .env.e2e & .env (+ enables merging env files in the future)
    • .env is the base & .env.e2e contains overrides such as Ports (9xxx for e2e vs 8xxx) and database URL --> prevents developers from accidentally hitting their regular db when running e2e tests locally
    • The override pattern is more maintainable than creating a .env.e2e file that has direct copies from .env.example + overridden values. If the required env values change in the future, we do not need to change them in multiple places.
  • Resolves a minor bug where running e2e locally on a Mac will result in a failure for one test
  • Adds a global-setup file that wipes any pre-existing e2e test db (in case a dev triggers a re-run of e2e tests locally before their prior run has completed
  • Adds the start of signup.spec.ts -- email verification will follow up a subsequent PR
  • Adds a warning for devs to start a separate e2e app server for better developer experience (slow app startup & UI mode does not have clear logging)
    • Does not throw

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • has no typecheck errors (npm run typecheck)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123
  • meets the standards outlined in the accessibility guidelines

Comment on lines -20 to -36
Project.find({}, {}, {
timeout: true
}).cursor().eachAsync((project) => {
console.log(project.name);
if (project.name.length < 256) {
console.log('Project name is okay.');
return Promise.resolve();
Project.find(
{},
{},
{
timeout: true
}
project.name = project.name.substr(0, 255);
project.slug = slugify(project.name, '_');
return project.save().then(() => {
console.log('Updated sketch slug to: ' + project.slug);
)
.cursor()
.eachAsync((project) => {
console.log(project.name);
if (project.name.length < 256) {
console.log('Project name is okay.');
return Promise.resolve();
}
project.name = project.name.substr(0, 255);
project.slug = slugify(project.name, '_');
return project.save().then(() => {
console.log('Updated sketch slug to: ' + project.slug);
});
})
.then(() => {
console.log('Done iterating over every sketch.');
process.exit(0);
});
}).then(() => {
console.log('Done iterating over every sketch.');
process.exit(0);
}); No newline at end of file

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

these lines are all due to auto-format on save

@clairep94
clairep94 marked this pull request as ready for review July 18, 2026 21:42
@clairep94
clairep94 force-pushed the clairep-setup_test_db_e2e branch from 795b00a to ca076c2 Compare July 18, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant