Unit Test & Git Rebase

JunePyo Suh·2020년 6월 9일
0

Testing


1. End to End Testing (E2E Test, aka. UI testing) : 실제로 브라우저에 띄웠을때 잘 나오는지, 버튼, 글 컴포넌트들이 잘 위치해있는지 확인하는 테스팅

  • 제일 오래 걸리고 테스트 비용도 비쌈
  1. Integration Testing :
  • subsystem 을 결합해서 함께 테스트 하는 방법
  • databse system 하고 view logic 을 합쳐서 postman 을 이용해서 테스트 한다던지..등
  • E2E > Integration Testing > Unit Testing
  1. Unit Test:
  • 테스트 할 수 있는 가장 작은 단위를 테스트 하는 코드를 작성해서 테스트 하는 것을 말함
  • unittest module, 혹은 pytest package 사용

TestCase : unittest 프레임 워크의 테스트 조직의 기본 단위
Fixture : 테스트를 진행할때 필요한 테스트용 데이터 혹은 설정 등을 이야기 함. 주로 테스트 가 실행되기 전이나 후에 생김.
assertion : unittest에서 테스트 하는 부분이 제대로 됬는지를 확인하는 부분. Assertion이 실패하면 테스트도 실패한다.

Git Rebase

Previously, to apply changes on remote master to local master, we checked out from local branch we were working on to local master, pull remote master to local master, and performed git merge master on local branch.
Git rebase is another way of going through this process, while ensuring that new changes be added to git log in a chronological order. In other words, parent commit (base) is changed to the most newly applied change. Tracking history can be made much easier if you use git rebasing appropriately. (Unlike fast forward merge)

Unless there hasn't been any change to remote master, conflicts may occur frequently when rebasing.

Steps

  1. git clone
  2. git checkout -b local/branch
  3. make changes
  4. git checkout master
  5. (Assuming there have been changes in remote master) git pull origin master, OR git fetch (메타 정보, 새로운 브렌치, 삭제된 브랜치 등등 을 가져옴); git pull origin master
  6. git rebase -i master (source) feature/edit (destination)
    기준 하나로 잡고, 나머지는 다 거기를 기준으로 하나로 합쳐주기:
    pick ~
    s ~

    s ~~~
  7. :wq, and then move to conflicting files and resolve those conflicts.
  8. git add . (stage the changes)
  9. (Assuming there are more commits with conflicts to resolve) git rebase --continue
  10. move to conflicting files and resolve conflicts
  11. git add .
  12. If no more conflicts to resolve, git rebase --continue command will display a list of commits from which you can choose a final commit to be shown to others
  13. git push origin local/branch
  14. Done!!

** if you think something has gone wrong during the rebasing process, use this command:
git rebase --abort

Git Flow

0개의 댓글