github.com/YousefHaggyHeroku/pack@v1.5.5/internal/builder/writer/shared_builder_test.go (about) 1 package writer_test 2 3 import ( 4 pubbldr "github.com/YousefHaggyHeroku/pack/builder" 5 "github.com/YousefHaggyHeroku/pack/internal/builder/writer" 6 "github.com/YousefHaggyHeroku/pack/internal/config" 7 "github.com/YousefHaggyHeroku/pack/internal/dist" 8 ) 9 10 var ( 11 testTopNestedBuildpack = dist.BuildpackInfo{ 12 ID: "test.top.nested", 13 Version: "test.top.nested.version", 14 } 15 testNestedBuildpack = dist.BuildpackInfo{ 16 ID: "test.nested", 17 Homepage: "http://geocities.com/top-bp", 18 } 19 testBuildpackOne = dist.BuildpackInfo{ 20 ID: "test.bp.one", 21 Version: "test.bp.one.version", 22 Homepage: "http://geocities.com/cool-bp", 23 } 24 testBuildpackTwo = dist.BuildpackInfo{ 25 ID: "test.bp.two", 26 Version: "test.bp.two.version", 27 } 28 testBuildpackThree = dist.BuildpackInfo{ 29 ID: "test.bp.three", 30 Version: "test.bp.three.version", 31 } 32 testNestedBuildpackTwo = dist.BuildpackInfo{ 33 ID: "test.nested.two", 34 Version: "test.nested.two.version", 35 } 36 37 buildpacks = []dist.BuildpackInfo{ 38 testTopNestedBuildpack, 39 testNestedBuildpack, 40 testBuildpackOne, 41 testBuildpackTwo, 42 testBuildpackThree, 43 } 44 45 order = pubbldr.DetectionOrder{ 46 pubbldr.DetectionOrderEntry{ 47 GroupDetectionOrder: pubbldr.DetectionOrder{ 48 pubbldr.DetectionOrderEntry{ 49 BuildpackRef: dist.BuildpackRef{ 50 BuildpackInfo: testTopNestedBuildpack, 51 }, 52 GroupDetectionOrder: pubbldr.DetectionOrder{ 53 pubbldr.DetectionOrderEntry{ 54 BuildpackRef: dist.BuildpackRef{BuildpackInfo: testNestedBuildpack}, 55 GroupDetectionOrder: pubbldr.DetectionOrder{ 56 pubbldr.DetectionOrderEntry{ 57 BuildpackRef: dist.BuildpackRef{ 58 BuildpackInfo: testBuildpackOne, 59 Optional: true, 60 }, 61 }, 62 }, 63 }, 64 pubbldr.DetectionOrderEntry{ 65 BuildpackRef: dist.BuildpackRef{ 66 BuildpackInfo: testBuildpackThree, 67 Optional: true, 68 }, 69 }, 70 pubbldr.DetectionOrderEntry{ 71 BuildpackRef: dist.BuildpackRef{BuildpackInfo: testNestedBuildpackTwo}, 72 GroupDetectionOrder: pubbldr.DetectionOrder{ 73 pubbldr.DetectionOrderEntry{ 74 BuildpackRef: dist.BuildpackRef{ 75 BuildpackInfo: testBuildpackOne, 76 Optional: true, 77 }, 78 Cyclical: true, 79 }, 80 }, 81 }, 82 }, 83 }, 84 pubbldr.DetectionOrderEntry{ 85 BuildpackRef: dist.BuildpackRef{ 86 BuildpackInfo: testBuildpackTwo, 87 Optional: true, 88 }, 89 }, 90 }, 91 }, 92 pubbldr.DetectionOrderEntry{ 93 BuildpackRef: dist.BuildpackRef{ 94 BuildpackInfo: testBuildpackThree, 95 }, 96 }, 97 } 98 99 sharedBuilderInfo = writer.SharedBuilderInfo{ 100 Name: "test-builder", 101 Trusted: false, 102 IsDefault: false, 103 } 104 105 localRunImages = []config.RunImage{ 106 {Image: "some/run-image", Mirrors: []string{"first/local", "second/local"}}, 107 } 108 )