railpack

Configure and troubleshoot Railpack builds, with emphasis on RAILPACK_* environment variables, railpack.json overlays, build-plan inspection, local CLI installation and usage, and local BuildKit containers. Use for Railpack provider configuration, custom install/build/start commands, Mise or Apt packages, build or runtime variables and secrets, generated-plan debugging, BUILDKIT_HOST errors, or running Railpack from a release or source checkout.

Install
npx skills add 'https://github.com/railwayapp/railpack/tree/main/.'
Incomplete bundle · no download
main · 21a254fScanned 2026-09-17

Contributors

GitHub-linked commit authors for this SKILL.md at the saved revision. Co-authors and history before file renames are not included.

File history ↗

core/generate/deploy_builder_test.go

core/generate/deploy_builder_test.goBrowse 1970 files
View on GitHub
← Back to SKILL.md
package generate import (	"testing" 	"github.com/railwayapp/railpack/core/plan"	"github.com/stretchr/testify/assert") func TestHasIncludeForStep(t *testing.T) {	tests := []struct {		name     string		inputs   []plan.Layer		stepName string		path     string		expected bool	}{		{			name:     "empty inputs",			inputs:   []plan.Layer{},			stepName: "build",			path:     ".",			expected: false,		},		{			name: "exact match",			inputs: []plan.Layer{				{Step: "build", Filter: plan.Filter{Include: []string{"."}}},			},			stepName: "build",			path:     ".",			expected: true,		},		{			name: "dot covers any path",			inputs: []plan.Layer{				{Step: "build", Filter: plan.Filter{Include: []string{"."}}},			},			stepName: "build",			path:     "/app/dist",			expected: true,		},		{			name: "any path covers dot",			inputs: []plan.Layer{				{Step: "build", Filter: plan.Filter{Include: []string{"/root/.cache", "."}}},			},			stepName: "build",			path:     ".",			expected: true,		},		{			name: "different step name",			inputs: []plan.Layer{				{Step: "install", Filter: plan.Filter{Include: []string{"."}}},			},			stepName: "build",			path:     ".",			expected: false,		},		{			name: "specific path match",			inputs: []plan.Layer{				{Step: "build", Filter: plan.Filter{Include: []string{"/app/node_modules"}}},			},			stepName: "build",			path:     "/app/node_modules",			expected: true,		},		{			name: "specific path no match",			inputs: []plan.Layer{				{Step: "build", Filter: plan.Filter{Include: []string{"/app/node_modules"}}},			},			stepName: "build",			path:     "/app/dist",			expected: false,		},		{			name: "specific path does not cover dot",			inputs: []plan.Layer{				{Step: "build", Filter: plan.Filter{Include: []string{"/app/node_modules"}}},			},			stepName: "build",			path:     ".",			expected: false,		},	} 	for _, tt := range tests {		t.Run(tt.name, func(t *testing.T) {			builder := NewDeployBuilder()			builder.DeployInputs = tt.inputs			result := builder.HasIncludeForStep(tt.stepName, tt.path)			assert.Equal(t, tt.expected, result)		})	}} func TestHasInputForStep(t *testing.T) {	builder := NewDeployBuilder()	builder.DeployInputs = []plan.Layer{		{Step: "build", Filter: plan.Filter{Include: []string{"apps/landing/.next/standalone"}}},	} 	assert.True(t, builder.HasInputForStep("build"))	assert.False(t, builder.HasInputForStep("install"))}