File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+
3+ - name : Add VSCode apt signing key if not present
4+ apt_key :
5+ id : BC528686B50D79E339D3721CEB3E94ADBE1229CF
6+ url : https://packages.microsoft.com/keys/microsoft.asc
7+ state : present
8+
9+ - name : Add Microsoft's VSCode repository into sources list
10+ apt_repository :
11+ repo : deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main
12+ state : present
13+
14+ - name : Install VSCode
15+ apt :
16+ name : code
17+ state : present
Original file line number Diff line number Diff line change 1414 - { role: testinfra, tags: "testinfra" }
1515 - { role: bashrc_d, tags: "bashrc_d" }
1616 - { role: git, tags: "git" }
17+ - { role: vscode, tags: "vscode" }
Original file line number Diff line number Diff line change 1+
2+ def test_vscode_apt_sources_list_exists_ (host ):
3+ assert host .file ('/etc/apt/sources.list.d/packages_microsoft_com_repos_vscode.list' ).exists
4+
5+ def test_vscode_apt_key_defined_ (host ):
6+ assert 'Microsoft (Release signing) <gpgsecurity@microsoft.com>' in host .run ('apt-key list' ).stdout
7+
8+ def test_vscode_command_is_found_ (host ):
9+ assert host .run ('which code' ).rc is 0
10+
11+ def test_vscode_version_command_succeeds_ (host ):
12+ assert host .run ('code --version' ).rc is 0
You can’t perform that action at this time.
0 commit comments