atom / teletype

Share your workspace with team members and collaborate on code in real time in Atom
https://teletype.atom.io
MIT License
2.41k stars 324 forks source link

Atom/teletype electron 5 fix #514

Closed darangi closed 4 years ago

darangi commented 4 years ago

Electron API changed when we upgraded from 4 to 5, it returns a different object structure, while electron 5 is still in nightly, we need to maintain both object structures to pass the tests and we will delete the extra/unnecessary tests once electron 5 reaches stable.

Fix: https://github.com/atom/teletype/pull/515

darangi commented 4 years ago

These are logs from the CI

 1) EditorBinding relays local selections and creates cursor decorations on the local editor based on the remote ones:
      AssertionError [ERR_ASSERTION] [ERR_ASSERTION]: Expected values to be loosely deep-equal:
[
  {
    head: Point {
      column: 4,
      row: 11
    },
    tail: Point {
      column: 0,
      row: 10
    }
  },
  {
    head: Point {
      column: 0,
      row: 20
    },
    tail: Point {
      column: 5,
      row: 20
    }
  },
  {
    head: Point {
      column: 2,
      row: 4
    },
    tail: Point {
      column: 0,
      row: 3
    }
  },
  {
    head: Point {
      column: 0,
      row: 5
    },
    tail: Point {
      column: 0,
      row: 6
    }
  }
]
should equal
[
  {
    head: {
      column: 2,
      row: 4
    },
    tail: {
      column: 0,
      row: 3
    }
  },
  {
    head: {
      column: 0,
      row: 5
    },
    tail: {
      column: 0,
      row: 6
    }
  },
  {
    head: {
      column: 4,
      row: 11
    },
    tail: {
      column: 0,
      row: 10
    }
  },
  {
    head: {
      column: 0,
      row: 20
    },
    tail: {
      column: 5,
      row: 20
    }
  }
]
      + expected - actual
       [
         {
           "head": {
      -      "column": 4
      -      "row": 11
      +      "column": 2
      +      "row": 4
           }
           "tail": {
             "column": 0
      -      "row": 10
      +      "row": 3
           }
         }
         {
           "head": {
             "column": 0
      -      "row": 20
      +      "row": 5
           }
           "tail": {
      -      "column": 5
      -      "row": 20
      +      "column": 0
      +      "row": 6
           }
         }
         {
           "head": {
      -      "column": 2
      -      "row": 4
      +      "column": 4
      +      "row": 11
           }
           "tail": {
             "column": 0
      -      "row": 3
      +      "row": 10
           }
         }
         {
           "head": {
             "column": 0
      -      "row": 5
      +      "row": 20
           }
           "tail": {
      -      "column": 0
      -      "row": 6
      +      "column": 5
      +      "row": 20
           }
         }
       ]

      at Context.<anonymous> (/home/travis/build/atom/teletype/test/editor-binding.test.js:97:12)
      at processImmediate (internal/timers.js:443:21)
  2) EditorBinding clears remote selections for disconnected remote site:
      AssertionError [ERR_ASSERTION] [ERR_ASSERTION]: Expected values to be loosely deep-equal:
[
  {
    head: Point {
      column: 4,
      row: 11
    },
    tail: Point {
      column: 0,
      row: 10
    }
  },
  {
    head: Point {
      column: 5,
      row: 20
    },
    tail: Point {
      column: 0,
      row: 20
    }
  },
  {
    head: Point {
      column: 2,
      row: 4
    },
    tail: Point {
      column: 0,
      row: 3
    }
  }
]
should equal
[
  {
    head: {
      column: 2,
      row: 4
    },
    tail: {
      column: 0,
      row: 3
    }
  },
  {
    head: {
      column: 4,
      row: 11
    },
    tail: {
      column: 0,
      row: 10
    }
  },
  {
    head: {
      column: 5,
      row: 20
    },
    tail: {
      column: 0,
      row: 20
    }
  }
]
      + expected - actual
       [
         {
           "head": {
      -      "column": 4
      -      "row": 11
      +      "column": 2
      +      "row": 4
           }
           "tail": {
             "column": 0
      -      "row": 10
      +      "row": 3
           }
         }
         {
           "head": {
      -      "column": 5
      -      "row": 20
      +      "column": 4
      +      "row": 11
           }
           "tail": {
             "column": 0
      -      "row": 20
      +      "row": 10
           }
         }
         {
           "head": {
      -      "column": 2
      -      "row": 4
      +      "column": 5
      +      "row": 20
           }
           "tail": {
             "column": 0
      -      "row": 3
      +      "row": 20
           }
         }
       ]

      at Context.<anonymous> (/home/travis/build/atom/teletype/test/editor-binding.test.js:138:12)
      at processImmediate (internal/timers.js:443:21)
  3) EditorBinding clears the tail of local and remote selection markers when they become empty after a text change:
      AssertionError [ERR_ASSERTION] [ERR_ASSERTION]: Expected values to be loosely deep-equal:
[
  {
    head: Point {
      column: 3,
      row: 0
    },
    tail: Point {
      column: 3,
      row: 0
    }
  },
  {
    head: Point {
      column: 6,
      row: 0
    },
    tail: Point {
      column: 6,
      row: 0
    }
  }
]
should equal
[
  {
    head: {
      column: 6,
      row: 0
    },
    tail: {
      column: 6,
      row: 0
    }
  },
  {
    head: {
      column: 3,
      row: 0
    },
    tail: {
      column: 3,
      row: 0
    }
  }
]
      + expected - actual
       [
         {
           "head": {
      -      "column": 3
      +      "column": 6
             "row": 0
           }
           "tail": {
      -      "column": 3
      +      "column": 6
             "row": 0
           }
         }
         {
           "head": {
      -      "column": 6
      +      "column": 3
             "row": 0
           }
           "tail": {
      -      "column": 6
      +      "column": 3
             "row": 0
           }
         }
       ]

      at Context.<anonymous> (/home/travis/build/atom/teletype/test/editor-binding.test.js:228:12)
      at processImmediate (internal/timers.js:443:21)