|
125 | 125 | expect(result.stdout).to include("Created matrix with 6 cells:\n - Acceptance Test Cells: 4\n - Spec Test Cells: 2")
|
126 | 126 | end
|
127 | 127 | end
|
| 128 | + |
| 129 | + context 'without arguments and GITHUB_REPOSITORY_OWNER is not puppetlabs' do |
| 130 | + let(:github_output) { Tempfile.new('github_output') } |
| 131 | + let(:github_output_content) { github_output.read } |
| 132 | + let(:result) { run_matrix_from_metadata_v2 } |
| 133 | + |
| 134 | + before do |
| 135 | + ENV['GITHUB_OUTPUT'] = github_output.path |
| 136 | + ENV['GITHUB_REPOSITORY_OWNER'] = 'aforkuser' |
| 137 | + end |
| 138 | + |
| 139 | + it 'run successfully' do |
| 140 | + expect(result.status_code).to eq 0 |
| 141 | + end |
| 142 | + |
| 143 | + it 'generates the matrix' do # rubocop:disable RSpec/ExampleLength |
| 144 | + expect(result.stdout).to include('::warning::Cannot find image for CentOS-6') |
| 145 | + expect(result.stdout).to include('::warning::Cannot find image for Ubuntu-14.04') |
| 146 | + expect(github_output_content).to include( |
| 147 | + [ |
| 148 | + 'matrix={', |
| 149 | + '"platforms":[', |
| 150 | + '{"label":"AmazonLinux-2","provider":"docker","image":"litmusimage/amazonlinux:2"},', |
| 151 | + '{"label":"AmazonLinux-2023","provider":"docker","image":"litmusimage/amazonlinux:2023"},', |
| 152 | + '{"label":"Ubuntu-18.04","provider":"docker","image":"litmusimage/ubuntu:18.04"},', |
| 153 | + '{"label":"Ubuntu-22.04","provider":"docker","image":"litmusimage/ubuntu:22.04"}', |
| 154 | + '],', |
| 155 | + '"collection":[', |
| 156 | + '"puppet7-nightly","puppet8-nightly"', |
| 157 | + ']', |
| 158 | + '}' |
| 159 | + ].join |
| 160 | + ) |
| 161 | + expect(github_output_content).to include( |
| 162 | + 'spec_matrix={"include":[{"puppet_version":"~> 7.24","ruby_version":2.7},{"puppet_version":"~> 8.0","ruby_version":3.2}]}' |
| 163 | + ) |
| 164 | + expect(result.stdout).to include("Created matrix with 10 cells:\n - Acceptance Test Cells: 8\n - Spec Test Cells: 2") |
| 165 | + end |
| 166 | + end |
128 | 167 | end
|
0 commit comments