NEXTSCRIBE

Rails 8 Tip: Leveraging Parallel Testing by Default

One of the most significant improvements in Rails 8 is the enhanced parallel testing system that now comes enabled by default. This feature dramatically reduces test suite execution time with minimal configuration.

What Changed in Rails 8

In previous Rails versions, you had to explicitly opt into parallel testing by adding configuration to your test environment. Rails 8 flips this approach - parallel testing is now enabled out of the box, automatically detecting your system's CPU count and utilizing those resources efficiently.

How to Get the Most Out of It

Here's how to leverage this feature effectively:

# config/environments/test.rb Rails.application.configure do # The default is now true, but you can specify the number of workers config.parallel_testing.workers = :number_of_processors # or set specific number # You can also configure specific worker counts for different test types config.parallel_testing.workers = { models: 4, controllers: 3, system: 2 } end

Managing Database Setup

With parallel testing, each worker needs its own database. Rails 8 automatically handles this with a new task:

bin/rails parallel:setup

This creates numbered databases for each worker (like myapp_test-1, myapp_test-2).

Dealing with Shared Resources

When tests run in parallel, be careful with shared resources. Rails 8 includes helpers to manage this:

class SomeTest < ActiveSupport::TestCase parallelize_with :processes do |worker| # Code that runs once per worker Setup.prepare_shared_resource_for_worker(worker) end test "something that uses isolated resources" do # This test can run in parallel end end

When to Turn It Off

Some tests may not work well in parallel. For specific test files:

class ComplexSystemTest < ApplicationSystemTestCase # Disable parallelization for just this test class self.use_parallel = false test "a complex flow that shouldn't run in parallel" do # Test code here end end

Enjoy the significantly faster test execution times with Rails 8's parallel testing defaults!

Getting Started with NextScribe: Your Modern Markdown Blog Platform

NextScribe is a modern, lightning-fast blogging platform that combines the power of Next.js, Supabase, and Tailwind CSS. In this post, I'll show you how to get up and running with NextScribe in just 5 minutes, and demonstrate some of its powerful markdown features.

What is NextScribe?

NextScribe is designed for developers and technical writers who want:

  • ๐Ÿ“ A clean, distraction-free writing experience
  • ๐ŸŽจ Beautiful, responsive design out of the box
  • ๐ŸŒ“ Dark/Light mode support
  • ๐Ÿš€ Blazing fast performance
  • ๐Ÿ” Secure authentication

5-Minute Setup

  1. Clone the repository:
git clone git@github.com:releasysaas/nextscribe.git cd nextscribe
  1. Install dependencies:
pnpm install
  1. Set up Supabase:

    • Create a project at Supabase
    • Import the schema from supabase/schema.sql
    • Copy your project URL and API keys
  2. Configure environment:

cp .env.example .env

Update with your Supabase details:

NEXT_PUBLIC_SUPABASE_URL=your-project-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
  1. Start the development server:
pnpm dev

That's it! Visit http://localhost:3000 to see your blog.

Markdown Editor Features

NextScribe comes with a powerful markdown editor. Here are some examples:

Text Formatting

You can write bold text, italic text, or both. Create lists:

  • Item 1
  • Item 2
    • Nested item
    • Another nested item

Code Blocks

def hello_nextscribe(): print("Welcome to NextScribe!")

Tables

FeatureSupported
Tablesโœ…
Code blocksโœ…
Math formulasโœ…

Block Quotes

NextScribe makes blogging beautiful and simple.

-- A happy developer

Next Steps

Now that you have NextScribe running, try:

  1. Creating your first post
  2. Customizing the theme
  3. Deploying to Vercel

Visit our GitHub repository for detailed documentation and updates.

Happy blogging with NextScribe! ๐Ÿš€๐Ÿš€๐Ÿš€