Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Win Testing Trophy Easily / テスティングトロフィーを獲得する / ...

Win Testing Trophy Easily / テスティングトロフィーを獲得する / PHPerKaigi 2023

Ken’ichiro Oyama

March 24, 2023
Tweet

More Decks by Ken’ichiro Oyama

Other Decks in Technology

Transcript

  1. 4 • https://github.com/k1LoW/tbls • CIϑϨϯυϦͳσʔλϕʔευΩϡϝϯτੜ ੒πʔϧ • PostgreSQL, MySQLͳͲͷRDBMS͚ͩͰͳ ͘ɺBigQuery΍Amazon

    DynamoDB, Cloud Spannerͱ͍ͬͨσʔλιʔεʹ΋ରԠ • υΩϡϝϯτΛॆ࣮ͤ͞Δػೳͱͯ͠ϝλ σʔλΛΞϊςʔγϣϯ͢Δ͜ͱ͕Մೳ • ςʔϒϧɺΧϥϜͳͲͷίϝϯτ෇༩͚ͩͰ ͳ͘λάɺϦϨʔγϣϯͳͲ tbls ࡞͍ͬͯΔOSS঺հ
  2. • https://github.com/k1LoW/octocov • ίʔυϝτϦΫεπʔϧ…ίʔυΧόϨοδɺCode to Test Ratioɺςετ࣮ߦ࣌ؒ • ଟ਺ͷϓϩάϥϛϯάݴޠͱɺओཁͳΧόϨοδϨϙʔτϑΥʔϚοτʹରԠ •

    GitHub Actionsͷactionͱͯ͠ίʔυϝτϦΫεΛूܭɺP/RίϝϯτɺϨϙʔτ • CLIπʔϧͱͯ͠ίʔυΧόϨοδΛूܭɻදࣔ • ΧόϨοδόοδੜ੒ octocov 5 5 ࡞͍ͬͯΔOSS঺հ
  3. 10 ςετߏ੒ ςετϐϥϛουʢTest pyramid / The Test Automation Pyramidʣ https://www.mountaingoatsoftware.com/blog/the-forgotten-layer-

    of-the-test-automation-pyramid Mike Cohn ʮSucceeding with Agile: Software Development Using Scrumʯ
  4. ςετɾϐϥϛου͸ɺςετɾεΠʔτʹ͓͍ͯɺ࣍ͷҟͳΔछྨͷς ετ͕ͦΕͧΕಛఆͷׂ߹ͰςετɾέʔεΛ࣋ͭΑ͏ʹͳ͍ͬͯΔɺͱ͍ ͏͜ͱΛఏএ͍ͯ͠Δ֓೦Ͱ͢ɻ • ୯ମςετʢUnitςετ ※ൃදऀ௥ه ʣ • ౷߹ʢintegrationʣςετ •

    E2EʢEnd-to-Endʣςετ ʢதུʣ ͜ͷςετɾϐϥϛουͷԣ෯͸ςετɾεΠʔτΛߏ੒͢Δ֤छྨͷς ετͷʹؚ·ΕΔςετɾέʔεͷ਺Λࣔ͠·͢ɻͦͷͨΊɺςετɾϐϥ ϛουͷͦ͏͕ԣʹ௕͍΋ͷ΄Ͳɺςετɾέʔε͕ଟ͍͜ͱʹͳΓ·͢ɻ ࣍ʹɺςετɾϐϥϛουͷߴ͞͸ɺର৅ͷςετ͕ͲΕ͘Β͍ΤϯυϢʔ βͷࢹ఺ʹ͍ۙͷ͔Λࣔ͠·͢ɻ 11 Vladimir Khorikov (ஶ), ਢాஐ೭ (຋༁)ʮ୯ମςετͷߟ͑ํ/࢖͍ํʯΑΓ “
  5. • React Testing Libraryͷ࡞ऀͰ͋ΔKent C. Doddsࢯ͕ࣔͨ͠ίϯηϓτ • ֤ςετ͝ͱͷ෯͕ςετϐϥϛουͱҟͳΔ • ౷߹ʢintegrationʣςετͷ෯͕େ͖͍


    ʹʢ୯७ʹ͸ʣέʔε਺͕ଟ͍ɺॏ఺తʹ ࡞੒͢ΔΠϝʔδ 12 ςετߏ੒ ςεςΟϯάτϩϑΟʔʢTesting trophyʣ https://kentcdodds.com/blog/the-testing-trophy-and-testing-classifications 
 https://twitter.com/kentcdodds/status/960723172591992832
  6. 13 “One thing that it doesn't show though is that

    as you move up the pyramid, the confidence quotient of each form of testing increases. (snip) Integration tests strike a great balance on the trade-offs between confidence and speed/expense. This is why it's advisable to spend most (not all, mind you) of your effort there. ͔͠͠ɺϐϥϛουͷ্ʹߦ͘΄ͲɺͦΕͧΕͷςετͷ৴པࢦ਺͕ߴ͘ͳΔ͜ͱ͸ɺ ͜ͷਤͰ͸ࣔ͞Ε͍ͯ·ͤΜɻ 
 ʢதུʣ ౷߹ςετ͸ɺ৴པੑͱ଎౓ɾඅ༻ͷτϨʔυΦϑͷόϥϯεΛ͏·͘ͱ͍ͬͯ·͢ɻ͜ ͷͨΊɺ΄ͱΜͲͷ࿑ྗΛͦ͜ʹඅ΍͢͜ͱ͕ਪ঑͞Ε·͢ (͢΂ͯͰ͸͋Γ·ͤΜ͕)ɻ https://kentcdodds.com/blog/write-tests ΑΓൈਮɺ຋༁
  7. 14 ςετߏ੒ ςετͷछྨ • ୯ମςετʢϢχοτςετʣ΍౷߹ςετɺE2EςετͦΕͧΕʹ͍ͭͯ͜Εͩͱ͍͏ఆٛ͸ͳ͍ • ͦͷ݁Ռɺೝ͕ࣝͣΕͯ͠·͏͜ͱ͕͋Δʢ͠ɺଟ͍ʣ • ॻ੶ʮ୯ମςετͷߟ͑ํ/࢖͍ํʯͰ͸୯ମςετͱ౷߹ςετΛ࣍ͷΑ͏ʹఆ͍ٛͯ͠Δ •

    ୯ମςετ͸ʮ1୯ҐͷৼΔ෣͍Λݕূ͢Δ͜ͱʯʮ࣮ߦ͕࣌ؒ୹͍͜ͱʯʮଞͷςε τɾέʔε͔Βִ཭͞Εͨঢ়ଶͰ࣮ߦ͞ΕΔ͜ͱʯͷ3ͭͷੑ࣭Λ࣋ͭ • 3ͭͷੑ࣭ͷ͏ͪ1ͭͰ΋ଛͳ͍ͬͯΔ΋ͷΛ౷߹ςετʹ෼ྨ͢Δ • ͨͩ͠ɺ্هఆٛͰ΋શ͕ͯ໌֬ʹͳΔ΋ͷͰ͸ͳ͘ɺྫ͑͹ʮִ཭͞Εͨঢ়ଶʯʹ͍ͭͯݹయ ֶ೿ͱϩϯυϯֶ೿Ͱߟ͑ํ͕ҟͳΔ
  8. 16 ςεταΠζ ςεταΠζ • ςετͷ࣮ߦ଎౓ͱܾఆੑʹண໨ͨ͠ςετ෼ྨ • ॻ੶ʮGoogleͷιϑτ΢ΣΞΤϯδχΞϦϯάʯΑΓ • ʮ࣮ߦ଎౓͕े෼ʹ଎ͯ҆͘ఆͨ͠ʢِཅੑ΍ِӄੑ͕ͳ͍ʹܾఆੑ͕͋ΔʣςετͳΒ͍͘Β͋ͬ ͯ΋ྑ͍ʯΘ͔Δ

    • Smallςετʢখςετʣ... ୯ҰϓϩηεʢγϯάϧεϨουʣ಺Ͱ࣮ߦ͞Εͳ͚Ε͹ͳΒͳ͍ɻsleepې ࢭɻI/OېࢭɻϒϩοΫېࢭ • Midiumςετʢதςετʣ... ୯ҰϚγϯ಺Ͱ࣮ߦ͞Εͳ͚Ε͹ͳΒͳ͍ɻlocalhostҎ֎ͷγεςϜ΁ͷωο τϫʔΫݺͼग़͠ېࢭ • Largeςετʢେςετʣ... ෳ਺Ϛγϯʹ·͕ͨΔςετ • ΑΓఆ͕ٛ͸͖ͬΓ͍ͯ͠ΔͷͰɺೝࣝΛἧ͑ΔͨΊʹຊൃදͰ͸ςεταΠζΛ࢖ͬͨઆ໌ΛࢼΈΔ
  9. 17 ςεταΠζ ૝ఆΞϓϦέʔγϣϯͱςεταΠζͷΠϝʔδ • ઐ༻ͷDBΛ࣋ͪଞͷίϯϙʔωϯτͱ࿈ ಈ͠ͳ͕Βಈ͘APIαʔό • Smallςετ͸ςετର৅͕APIαʔό಺ ෦ •

    Mediumςετ͸APIαʔόઐ༻DB·Ͱ Λςετσʔλϕʔεͱͯ͠༻ҙ • Largeςετ͸ίϯϙʔωϯτશମͷಈ ࡞͕ର৅
  10. 20 ςεταΠζ ྑ͍ςετ • ॻ੶ʮ୯ମςετͷߟ͑ํ/࢖͍ํʯʹΑΔͱɺ
 ʮྑ͍ʢ୯ମʣςετΛߏ੒͢Δ4ຊͷபʯ͸࣍ͷ4ͭ 1. ୀߦʢregressionʣʹର͢Δอޢ 2. ϦϑΝΫλϦϯά΁ͷ଱ੑ

    3. ਝ଎ͳϑΟʔυόοΫ 4. อकͷ͠΍͢͞ • ʮୀߦʹର͢ΔอޢʯʮϦϑΝΫλϦϯά΁ͷ଱ੑʯʮਝ଎ ͳϑΟʔυόοΫʯ͸ޓ͍ʹഉ൓͢Δੑ࣭ͳͷͰશͯΛ੒Γ ཱͨͤΔ͜ͱ͸Ͱ͖ͳ͍ • ྑ͍ςετΛ࡞ΔͨΊʹόϥϯεΛௐ੔͢Δඞཁ͕͋Δ Vladimir Khorikov (ஶ), ਢాஐ೭ (຋༁)ʮ୯ମςετͷߟ͑ํ/࢖͍ํʯΑΓ
  11. • Largeςετ > Midiumςετ > SmallςετͷॱͰʮୀߦʹର͢Δอޢʯ͸ڧྗʹͳ Δ͕ɺอकʹ͔͔Δίετ΋্͕Δ͠ɺਝ଎ͳϑΟʔυόοΫ͸ಘΒΕͳ͍ɻ • ͔ͩΒɺอकίετͱਝ଎ͳϑΟʔυόοΫΛߟ͑Δͱςετέʔεͷ਺͸Smallς ετ

    > Midiumςετ > LargeςετͷॱͰखް͍ͯ͘͘͠ͱྑ͍ɺͱ͍͏ઓུ • LargeςετΛબ୒͢Δͷ͸Midiumςετ΍SmallςετͰ͸อޢͰ͖ͳ͍ςε τର৅͕͋Δ৔߹ͳͲͳͷͰɺඞવతʹগͳ͘ͳΔ • Ref: https://www.mountaingoatsoftware.com/blog/the-forgotten-layer-of-the-test- automation-pyramid 22 ςεταΠζ ςεταΠζͰߟ͑Δςετϐϥϛουͷςετઓུ
  12. • ʢ஫ҙɿKentࢯ͸ςεταΠζͷ෼ྨͰ͸ओு͍ͯ͠ͳ͍ʣ • ʮ৴པੑ㲈඼࣭อূ㲈ୀߦʹର͢Δอޢʯͷ؍఺͕ॏཁ • Largeςετ > Mediumςετ > SmallςετͷॱͰςετͷ৴པࢦ਺ʢ඼࣭อ

    ূ΁ͷߩݙ౓ʣ͸ߴ͘ͳΔ • ͱ͸͍͑LargeςετΛॏࢹ͢Δͱʮਝ଎ͳϑΟʔυόοΫʯ͕ແʹ… • ʮ৴པੑ㲈඼࣭อূ㲈ୀߦʹର͢Δอޢʯͷ؍఺ͰɺMediumςετ͸τϨʔυΦϑ ͷόϥϯεΛ͏·͘ͱ͍ͬͯΔͷͰɺMediumςετʹॏ఺Λஔ͘ͱ͍͏ઓུ 23 ςεταΠζ ςεταΠζͰߟ͑ΔςεςΟϯάτϩϑΟʔͷςετઓུ
  13. • ։ൃݴޠͱͯ͠GoΛબ୒ • APIͷఆٛʹOpenAPI Spec v3Λ࠾༻͠εΩʔϚۦಈ։ൃΛߦ͏ • OpenAPI Document͔Βαʔό/ΫϥΠΞϯτͷίʔυΛࣗಈੜ੒ͯ͠࢖༻ •

    APIαʔόઐ༻ͷӬଓԽྖҬͱͯ͠γϯϓϧʹRDBMSΛ࠾༻ • ΠϛϡʔλϒϧϞσϧͷߟ͑ํΛ΋ͱʹσʔλϞσϦϯάΛ࣮ࢪ • ʢݱ࣌఺ͷ։ൃن໛ʣAPIύε਺38ɺςʔϒϧ਺92 28 ςετର৅ΞϓϦέʔγϣϯͷཁ݅ͱΞʔΩςΫνϟ ΞʔΩςΫνϟ/։ൃํ਑
  14. • ໋୊ʮ௕ظతʹޮՌ͕࣋ଓ͢ΔςετεΠʔτʯ • ௕ظతʹ࢒Δ΋ͷΛத৺ʹςετΛߏ੒͍͚ͯ͠͹ޮՌ΋࣋ଓ͢Δ͸ͣ • ֎෦ͱͷΠϯλʔϑΣʔεͰ͋ΔAPIεΩʔϚ͸ʁ • ֎෦ͱͷ઀఺͕͋ΔҎ্͸APIͷߋ৽͕͋Γͭͭ΋࢒Δ͸ͣ • σʔλϕʔεʢεΩʔϚʣ͸ʁ

    • ʮσʔλϕʔεͷण໋͸ΞϓϦέʔγϣϯΑΓ΋௕͍ʯby ીࠜ૖େ aka ͦʔ͍ͩ • Ͱ͸ɺΞϓϦέʔγϣϯͷ࣮૷͸ʁ 31 ςετઓུΛߟ͑Δ ௕ظతʹςετͷՁ஋Λҡ࣋͢ΔͨΊʹ
  15. • ࠾༻ͨ͠ύοέʔδʢϥΠϒϥϦʣ͕௕ظతʹϝϯςφϯε͞ΕΔͷ͔͸Θ͔Βͳ͍ • େମΛඪ४ύοέʔδʹدͤͨɻ͕ɺͦΕͰ΋༗໊ύοέʔδͷΞʔΧΠϒͷӨڹΛड͚ͨ • ͜Ε͸ࣗ෼ୡͰϝϯςφϯε͍͚ͯ͠͹ྑ͍ • ࠾༻ͨ͠ΞϓϦέʔγϣϯΞʔΩςΫνϟ͕௕ظతʹ࣋ଓ͢Δ͔Θ͔Βͳ͍ • Ͳ͏͍͏ΞʔΩςΫνϟ͕௕ظతʹྑ͍ͷ͔Θ͔Βͳ͍

    • ͦ΋ͦ΋౰࣌͸։ൃॳظͰΞʔΩςΫνϟͷݕ౼΋Ͱ͖͍ͯͳ͍ • Θ͔Βͳ͍ofΘ͔Βͳ͍ • ʢ௕ظӡ༻ʹ଱͑ΒΕΔ͔ͱ͍͏؍఺Ͱʣࣗ෼͕ࠓ͔Βઃܭ͢ΔΞϓϦέʔγϣϯ͕ઃܭ͢Δલ ͔Βطʹ৴༻Ͱ͖ͳ͍ 32 ςετઓུΛߟ͑Δ ΞϓϦέʔγϣϯ͕৴༻Ͱ͖ͳ͍
  16. • Mediumςετͷίετ͕Smallςετʹൺ΂ͯେ͖͍ • ςετͷ࣮ߦίετʢʮਝ଎ͳϑΟʔυόοΫʯʣ • ҰൠతʹMediumςετ͸SmallςετΑΓ࣮ߦ͕࣌ؒ௕͘ͳΓ͕ͪ • →ςετͷฒߦ࣮ߦͷ࢓૊ΈͰ؇࿨ͭͭ͠΋ɺ͋Δҙຯڐ༰͢Δ • ςετͷ࡞੒ɾอकίετʢʮอकͷ͠΍͢͞ʯʣ

    • ʮAPIʹHTTPϦΫΤετΛૹ৴ͯ͠ҙਤͨ݁͠Ռ΍ঢ়ଶʹͳ͍ͬͯΔ͔Λ֬ೝ ͢ΔʯςετΛॻ͘͜ͱ͕୯७ʹ໘౗ • →Ͱ͖ΔݶΓ؆୯ʹॻ͚Δ࢓૊ΈΛߏங͢Δ͜ͱͰର߅͢Δ 38 ςετઓུΛ࣮ݱ͢ΔͨΊͷ࢓૊Έ ςεςΟϯάτϩϑΟʔͷ՝୊ͱͦͷ՝୊΁ͷର߅खஈ
  17. 39

  18. • runn ( means "Run N". is pronounced /rʌ́n én/.

    ) is a package/tool for running operations following a scenario. • γφϦΦΛYAMLͰॻ͍ͯͦΕΛ΋ͱʹૢ࡞ʢΦϖϨʔγϣϯʣΛࣗಈԽͰ͖Δύο έʔδ/πʔϧ • ίϚϯυʢrunnίϚϯυʣͱͯ͠ʢ΋ɺGoͷύοέʔδͱͯ͠΋ʣ࢖͑Δ • runn run [γφϦΦσΟϨΫτϦ]/*.yml • ʮΦϖϨʔγϣϯࣗಈԽʯͱ޿ൣғΛλʔήοτʹ͍ͯ͠Δ͕ɺAPIͷγφϦΦς ετ͕ϑΝʔετϓϥΠΦϦςΟͳϢʔεέʔεʢ։ൃͷ͖͔͚ͬͰ΋͋ΔͨΊʣ 40 https://github.com/k1LoW/runn runn
  19. • 1όΠφϦͷγφϦΦ࣮ߦͷCLIίϚϯυʢπʔϧʣͱͯ͠࢖༻Ͱ͖Δ • 1όΠφϦ = CIϑϨϯυϦ • ͞·͟·ͳϓϩτίϧʹରԠ͓ͯ͠Γɺ1ͭͷγφϦΦ಺Ͱෳ਺૊Έ߹ΘͤΔ͜ͱ͕Մೳ • HTTP

    • gRPC • DatabaseʢSQLʣ • Chrome DevTools Protocol • ೚ҙίϚϯυͷ࣮ߦʢϩʔΧϧ/SSHʣ • GoͷTest Helperʢύοέʔδʣͱͯ͠࢖༻Ͱ͖Δ 41 https://github.com/k1LoW/runn runnͷಛ௃ʢv0.64.1ʣʢ1/2ʣ
  20. 42 https://github.com/k1LoW/runn runnͷಛ௃ʢv0.64.1ʣʢ2/2ʣ • γφϦΦϑΝΠϧʢYAMLʣͷϑΥʔϚοτ͕OpenAPI SpecϥΠΫ • γφϦΦ಺ͷεςοϓؒͷ஋͕ࣗಈͰ࿈ܞ͞Ε͍ͯΔ • ʮεςοϓAΛ࣮ߦ͔ͯ͠Βͦͷ݁ՌΛ࢖ͬͯεςοϓBΛ࣮ߦ͢Δʯͱ͍͏γφϦΦΛߏங͠΍͍͢

    • ෳ਺ͷγφϦΦͷ࣮ߦΛ૝ఆ࣮ͨ͠૷ • ෳ਺ͷγφϦΦͷ෼ׂ࣮ߦɺαϯϓϦϯά࣮ߦɺϥϯμϜ࣮ߦɺฒߦ࣮ߦͳͲ͕Մೳ • ϧʔϓ࣮ߦ΍ϦτϥΠ࣮ߦͷ࢓૊Έ͕૊ΈࠐΈͰඋΘ͍ͬͯΔ • ಉ͡γφϦΦϑΝΠϧΛ࢖ͬͨෛՙςετʢϩʔυςετʣ͕Մೳ • ίϚϯυΛ runn run ͔Β runn loadt ʹมߋ͢Δ͚ͩɻෳ਺γφϦΦ࣮ߦ΋ͦͷ··Մೳ • γφϦΦ࣮ߦͷϩά΋ه࿥Մೳ • γφϦΦ࣮ߦͷϓϩϑΝΠϧ΋औಘՄೳʢ֤εςοϓͷܦա࣌ؒʣ
  21. • runn͸1ͭҎ্ͷγφϦΦΛ࣮ߦͯ͠ɺͦΕͧΕͷ੒ޭ/ࣦഊΛΈΔ • 1ͭͷγφϦΦ͸1ͭҎ্ͷεςοϓ͔Βߏ੒͞Ε͍ͯΔ • 1γφϦΦ1YAMLϑΝΠϧʹͳ͍ͬͯΔʢϥϯϒοΫͱݺΜͰ͍Δʣ • γφϦΦ͝ͱʹϥϯφʔͱݺΜͰ͍Δεςοϓ࣮ߦίϯϙʔωϯτΛఆٛ͠ɺͦͷϥϯφʔΛ࢖֤ͬͯε ςοϓΛ࣮ߦ͍ͯ͘͠ •

    ϥϯφʔʹ͸γφϦΦ಺ʹఆ͕ٛඞཁͳ௨ৗͷϥϯφʔͱɺطʹrunnͰ༻ҙ͍ͯ͠ΔϏϧτΠϯϥϯφʔͷ2 छྨ͕͋Δ • ϥϯφʔ: HTTPϥϯφʔɺDBϥϯφʔɺgRPCϥϯφʔɺCDPϥϯφʔɺSSHϥϯφʔ • ϏϧτΠϯϥϯφʔ: ExecϥϯφʔɺTestϥϯφʔɺDumpϥϯφʔɺIncludeϥϯφʔɺBindϥϯφʔ 43 https://github.com/k1LoW/runn runnͷΞʔΩςΫνϟ
  22. • γφϦΦϑΝΠϧ࡞੒ͷͨΊͷαϙʔτίϚϯυ • runn newͷҾ਺ʹ஋Λ౉͢͜ͱͰγφϦΦϑΝΠϧΛ࡞੒͢Δ • cURLίϚϯυ • gRPCurlίϚϯυ •

    ΞΫηεϩά • ʢOpenAPI SpecͷυΩϡϝϯτʁʣ • ʢPostmanͷCollectionʁʣ • طଘͷγφϦΦʹεςοϓͱͯ͠௥Ճ͢Δ͜ͱ΋Մೳ 54 https://github.com/k1LoW/runn runn new
  23. • ࠓճ૝ఆͨ͠MediumςετʢAPI call + DBʣΛSmallςετฒΈʹ؆୯ʹ͢Δπʔϧͱͯ͠ runnΛ։ൃɻ • ςετͷ࣮ߦ࣌ؒ΁ͷର߅ • ฒߦ࣮ߦ΍෼ׂ࣮ߦͷͨΊͷػೳΛఏڙ

    • ࣮ߦ࣌ؒΛϓϩϑΝΠϧ͢ΔͨΊͷػೳΛఏڙ • ςετͷ࡞੒ɾอकίετ΁ͷର߅ • OpenAPI SpecʢϥΠΫʣɺSQLɺLinuxίϚϯυͳͲɺ௚ײతʹॻ͚ΔΑ͏ʹ͢Δ͜ͱͰ ࡞੒ίετΛܰݮ • Մಡੑͷྑ͔͞ΒAPIૢ࡞αϯϓϧͱͯ͠ͷซ༻ͳͲͰอकίετΛܰݮ 56 ςετઓུΛ࣮ݱ͢ΔͨΊͷ࢓૊Έ πʔϧͰςεςΟϯάτϩϑΟʔͷ՝୊ʹର߅͢Δ
  24. • ʢ͋͘·Ͱ1ͭͷࢦඪͱͯ͠ʣ1ͭͷγφϦΦ͋ͨΓͷίʔυΧόϨοδ͕ඇৗʹେ͖͍ͨΊʮϦϑΝΫλϦϯά΁ͷ଱ੑʯ ʮୀߦʹର͢Δอޢʯʹରͯ͠ޮՌ͕େ͖͍ • γφϦΦͷ֦ॆ΋YAMLΛॻ͚ͩ͘Ͱྑ͍ • Ұ౓૊ΈࠐΜͰ͠·͑͹ɺ͋ͱ͸YAMLΛॻ͚ͩ͘ʹͳΔͨΊɺ͔ͳΓḿͬͨɻ • ḿΓ͗ͯ͢ςετ࣮ߦ͕࣌ؒ૿େ͠ɺςετ෼ׂ͕ඞཁʹͳͬͨ •

    ςετσʔλϕʔεʹ΋ؾܰʹΫΤϦΛൃߦͰ͖ΔͷͰγφϦΦ͕࡞੒͠΍͍͢ • γφϦΦ͕OpenAPI SpecϥΠΫͰ͋Δ͜ͱ͔ΒΤϯδχΞʹͱͬͯಡΈ΍͘͢ɺͦͷ··ΦϯϘʔσΟϯάʹ໾ʹཱͬͨ ʢAPIར༻ଆ΁ͷઆ໌ͳͲʣ • ॻ͖΍͍͢=ಡΈ΍͍͢ • ϫϯόΠφϦͷͨΊΠϯετʔϧ΋؆୯ɻCI΁ͷ૊ΈࠐΈ΋༰қɻ • runnͷόάΛআ͚͹ςετͷܾఆੑ΋୲อͰ͖͍ͯΔ 57 ςετઓུΛ࣮ݱ͢ΔͨΊͷ࢓૊Έ ࣮ࡍͲ͏͔ͩͬͨ
  25. • ΞϓϦέʔγϣϯσϓϩΠ௚ޙͷಈ࡞֬ೝͷͨΊͷ؆қతͳϦάϨογϣϯςετͷ ඞཁੑ • ϖύϘ͸͞·͟·ͳٕज़ελοΫͰߏங͞Εͨଟ͘ͷαʔϏεΛӡ༻͍ͯ͠Δ • ؆қͰྑ͍ɻ͔͠͠ɺʮϒϥ΢βϕʔεʯʮ։ൃݴޠʹدΒͳ͍͜ͱʯʮηοτ Ξοϓ͕؆୯Ͱ͋Δ͜ͱʯʮςετ࡞੒ֶ͕शίετ͕খ͍͜͞ͱʯ͕ཁ݅ + Chrome

    DevTools ProtocolʹରԠ͢Δ͜ͱͰrunnͰ؆қج൫Λߏங • ChromeʢChromiumʣࠐΈͷDocker imageΛ༻ҙ͢Δ͜ͱͰ্هཁ݅Λຬͨͨ͠ • docker pull ghcr.io/k1low/runn:latest 58 ςετઓུΛ࣮ݱ͢ΔͨΊͷ࢓૊Έ ʢ͓·͚ʣ૝ఆ֎ͷϢʔεέʔε: ϦάϨογϣϯςετ
  26. ͓ΘΓʹ 62 ʮrunn ΫοΫϒοΫʯ • runnͷ࢖͍ํΛ঺հ͢ΔZennϒοΫ • ϨγϐܗࣜͰಋೖ͔Βߴ౓ͳ࢖͍ํ·Ͱ Λऩ࿥ •

    ෆఆظͰϨγϐΛ௥Ճ΍ฤूΛ͢ΔܗͰ ӡ༻͍ͯ͠·͢ • ༗ྉͰ͕͢ແྉެ։ൣғ΋ଟ͋͘Γ·͢ • https://zenn.dev/k1low/books/runn- cookbook