|
1 | 1 | use core::panic;
|
2 | 2 | use std::fs::{self, canonicalize, copy, create_dir_all, remove_dir_all, File};
|
3 |
| -use std::io::{Cursor, Read, Write}; |
| 3 | +use std::io::{Read, Write}; |
4 | 4 | use std::path::{Path, PathBuf};
|
5 | 5 | use std::process::Command;
|
| 6 | +use std::{env, path}; |
6 | 7 |
|
| 8 | +use aws_config::BehaviorVersion; |
7 | 9 | use aws_sdk_cloudformation::types::{Capability, OnFailure};
|
8 | 10 |
|
9 | 11 | use aws_config::meta::region::RegionProviderChain;
|
@@ -92,7 +94,7 @@ struct EndToEndTest<'a> {
|
92 | 94 | language_boilerplate_dir: String,
|
93 | 95 | test_working_dir: String,
|
94 | 96 | expected_outputs_dir: String,
|
95 |
| - snapshots_zip: ZipArchive<Cursor<&'a [u8]>>, |
| 97 | + snapshots_zip: ZipArchive<File>, |
96 | 98 | skip_cdk_synth: bool,
|
97 | 99 | }
|
98 | 100 |
|
@@ -139,9 +141,11 @@ impl EndToEndTest<'_> {
|
139 | 141 | other => panic!("Unsupported language: {other}"),
|
140 | 142 | };
|
141 | 143 |
|
142 |
| - let cursor: Cursor<&[u8]> = |
143 |
| - std::io::Cursor::new(include_bytes!("./end-to-end-test-snapshots.zip")); |
144 |
| - let snapshots_zip = zip::read::ZipArchive::new(cursor) |
| 144 | + let source = File::open(path::PathBuf::from( |
| 145 | + env::var("END_TO_END_SNAPSHOTS").unwrap(), |
| 146 | + )) |
| 147 | + .unwrap(); |
| 148 | + let snapshots_zip = ZipArchive::new(source) |
145 | 149 | .expect("Failed to convert end-to-end-test-snapshots.zip contents into ZipArchive");
|
146 | 150 |
|
147 | 151 | EndToEndTest {
|
@@ -209,7 +213,10 @@ impl EndToEndTest<'_> {
|
209 | 213 | async fn create_cfn_stack(&mut self) {
|
210 | 214 | println!("Verifying a CloudFormation stack can be created from original template");
|
211 | 215 | let region_provider = RegionProviderChain::default_provider().or_else("us-east-1");
|
212 |
| - let config = aws_config::from_env().region(region_provider).load().await; |
| 216 | + let config = aws_config::defaults(BehaviorVersion::latest()) |
| 217 | + .region(region_provider) |
| 218 | + .load() |
| 219 | + .await; |
213 | 220 | let client = Client::new(&config);
|
214 | 221 |
|
215 | 222 | if let Ok(mut create_first_template) = self
|
|
0 commit comments