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

ユニットテストが入れられないレガシーなソースでCIが回せるようになった

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for MiuraKatsu MiuraKatsu
December 15, 2018

 ユニットテストが入れられないレガシーなソースでCIが回せるようになった

Avatar for MiuraKatsu

MiuraKatsu

December 15, 2018
Tweet

More Decks by MiuraKatsu

Other Decks in Technology

Transcript

  1. ϨΨγʔ୤٫΁ͷୈҰา w ιʔε؅ཧΛ(JUIVCʹू໿ɺϒϥϯνӡ༻ w ෳ਺%FW؀ڥ΋༻ҙɿ%FWʙ%FW·Ͱ४උ w +FOLJOTʹΑΔࣗಈ%FQMPZͷಋೖ w %FQMPZFS QIQ

    $BQJTUSBOPΈ͍ͨͳ΍ͭͷ1)1൛ w %FWʙ%FWʹͦΕͧΕϒϥϯνࢦఆͰ%FQMPZՄೳ w 7BHSBOUͰͷ-PDBM؀ڥɿݸਓͷ։ൃ؀ڥ͸͜͜ɻ
  2. EPDLFSDPNQPTFZNM version: '2' services: codecept: image: codeception/codeception depends_on: - chrome

    - firefox volumes: - './tests:/project/tests' - './codeception.yml:/project/codeception.yml' chrome: image: 'selenium/standalone-chrome-debug:2.53.1' ports: - '5901:5900' firefox: image: 'selenium/standalone-firefox-debug:2.53.1' ports: - '5902:5900'
  3. ίϚϯυ w TFMFOJVNαʔό্ཱͪ͛ >docker-compose up -d chrome firefox w EPDLFS಺ͷCSPXTFSͷڍಈ֬ೝ

    7/$  >open vnc://x:[email protected]:5901 w $PEFDFQUJPOͰͷςετ࣮ߦ >docker-compose run codecept run -x optional -vv -- html=_report.html --env firefox --env chrome --env phpbrowser -g all
  4. .BLFpMF .PHONY: all DOCKER_COMPOSE ?= docker-compose GROUP ?= all all:

    ##@test [TEST] shorthand for $(MAKE) up run-tests up: ##@development start stack $(DOCKER_COMPOSE) up -d chrome firefox run-tests: ##@test run tests $(DOCKER_COMPOSE) run codecept run -x optional -vv -- html=_report.html --env firefox --env chrome --env phpbrowser -g ${GROUP}
  5. ޻෉̎ w EFW؀ڥͳͷͰIUUQͷΞΫηε΋*1ߜͬͯΔ w ςετͷ౎౓ηΩϡϦςΟάϧʔϓʹ௥Ճɾ࡟আ #!/bin/sh export AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}

    export AWS_DEFAULT_REGION="ap-northeast-1" #dev-circleci-codeception-sg COMSECURITYGROUP=“sg-yoursecuritygroupid“ MYIP=`curl -s ifconfig.me` aws ec2 authorize-security-group-ingress --group-id ${COMSECURITYGROUP} -- protocol tcp --port 443 --cidr ${MYIP}/32 aws ec2 revoke-security-group-ingress --group-id ${COMSECURITYGROUP} -- protocol tcp --port 443 --cidr ${MYIP}/32