Skip to content

Commit 3aeab93

Browse files
CLOUDP-338207: Terraform: support OIDC configs in mongodbatlas_stream_connection
1 parent 65d7a6c commit 3aeab93

File tree

9,807 files changed

+3244358
-31
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

9,807 files changed

+3244358
-31
lines changed

QUICK_FIX_GUIDE.md

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
# Quick Fix Guide: Running Acceptance Tests
2+
3+
## ✅ Problem Fixed!
4+
5+
Your authentication issue has been resolved. The `test-dev.env` file has been updated with `export` statements.
6+
7+
---
8+
9+
## 🚀 How to Run Tests Now
10+
11+
### 1. Simple One-Liner (Recommended)
12+
```bash
13+
source test-dev.env && TF_ACC=1 go test ./internal/service/streamprocessor -run TestAccStreamProcessor_basic -v -timeout 300m
14+
```
15+
16+
### 2. Step by Step
17+
```bash
18+
# Load environment
19+
source test-dev.env
20+
21+
# Verify it's loaded correctly
22+
echo $MONGODB_ATLAS_BASE_URL
23+
# Should output: https://cloud-dev.mongodb.com
24+
25+
# Run the test
26+
TF_ACC=1 go test ./internal/service/streamprocessor -run TestAccStreamProcessor_basic -v -timeout 300m
27+
```
28+
29+
### 3. Using Helper Script
30+
```bash
31+
chmod +x run_stream_processor_tests.sh
32+
./run_stream_processor_tests.sh TestAccStreamProcessor_basic
33+
```
34+
35+
---
36+
37+
## 📋 Recommended Tests to Run
38+
39+
### Start with Basic Test (Most Reliable)
40+
```bash
41+
source test-dev.env && TF_ACC=1 go test ./internal/service/streamprocessor -run TestAccStreamProcessor_basic -v -timeout 300m
42+
```
43+
44+
### Other Working Tests
45+
```bash
46+
# JSON formatting test
47+
source test-dev.env && TF_ACC=1 go test ./internal/service/streamprocessor -run TestAccStreamProcessor_JSONWhiteSpaceFormat -v -timeout 300m
48+
49+
# With options test
50+
source test-dev.env && TF_ACC=1 go test ./internal/service/streamprocessor -run TestAccStreamProcessor_withOptions -v -timeout 300m
51+
52+
# Kafka source test
53+
source test-dev.env && TF_ACC=1 go test ./internal/service/streamprocessor -run TestAccStreamProcessor_kafkaSource -v -timeout 300m
54+
```
55+
56+
---
57+
58+
## ⚠️ Known Issues
59+
60+
### State Transition Tests May Fail
61+
The `TestAccStreamProcessor_StateTransitionsUpdates` test has known failures related to STOPPED state handling. This is a provider bug, not your setup.
62+
63+
**Failing subtests:**
64+
- `StartedToStopped`
65+
- `StoppedToStopped`
66+
- `StoppedToStarted`
67+
68+
**Passing subtests:**
69+
- `CreatedToCreated`
70+
- `CreatedToStarted`
71+
- `StartedToStarted`
72+
73+
---
74+
75+
## 🔍 Verify Your Setup
76+
77+
Run this to verify everything is configured correctly:
78+
```bash
79+
bash verify_env.sh
80+
```
81+
82+
Expected output:
83+
```
84+
✅ All required environment variables are set correctly!
85+
```
86+
87+
---
88+
89+
## 🎯 What Changed
90+
91+
### Before (Broken)
92+
```bash
93+
# test-dev.env
94+
MONGODB_ATLAS_BASE_URL=https://cloud-dev.mongodb.com
95+
MONGODB_ATLAS_PUBLIC_KEY=lqskkswx
96+
# ... (no export statements)
97+
```
98+
99+
**Result**: Variables not exported → Test used production URL → 401 Unauthorized
100+
101+
### After (Fixed)
102+
```bash
103+
# test-dev.env
104+
export MONGODB_ATLAS_BASE_URL=https://cloud-dev.mongodb.com
105+
export MONGODB_ATLAS_PUBLIC_KEY=lqskkswx
106+
# ... (with export statements)
107+
```
108+
109+
**Result**: Variables exported → Test uses dev URL → Authentication works ✅
110+
111+
---
112+
113+
## 💡 Pro Tips
114+
115+
1. **Always source the env file in the same command**:
116+
```bash
117+
source test-dev.env && TF_ACC=1 go test ...
118+
```
119+
120+
2. **Check which environment you're using**:
121+
```bash
122+
source test-dev.env
123+
echo $MONGODB_ATLAS_BASE_URL
124+
```
125+
126+
3. **Run one test at a time initially**:
127+
```bash
128+
source test-dev.env && TF_ACC=1 go test ./internal/service/streamprocessor -run TestAccStreamProcessor_basic -v -timeout 300m
129+
```
130+
131+
4. **Use verbose output** (`-v`) to see detailed progress
132+
133+
5. **Increase timeout** if tests are slow:
134+
```bash
135+
-timeout 600m # 10 hours
136+
```
137+
138+
---
139+
140+
## 📊 Test Results Summary
141+
142+
From your last run:
143+
- ✅ Authentication: **WORKING**
144+
- ✅ Environment: **CORRECT** (cloud-dev.mongodb.com)
145+
- ✅ 3 out of 6 state transition tests: **PASSING**
146+
- ❌ 3 state transition tests: **FAILING** (known provider bug)
147+
148+
---
149+
150+
## 🆘 Troubleshooting
151+
152+
### Still Getting 401 Unauthorized?
153+
```bash
154+
# Make sure you're sourcing the file
155+
source test-dev.env
156+
157+
# Verify the variable is set
158+
echo $MONGODB_ATLAS_BASE_URL
159+
# Should show: https://cloud-dev.mongodb.com
160+
161+
# If empty, the export didn't work
162+
# Try running the commands directly:
163+
export MONGODB_ATLAS_BASE_URL=https://cloud-dev.mongodb.com
164+
export MONGODB_ATLAS_PUBLIC_KEY=lqskkswx
165+
export MONGODB_ATLAS_PRIVATE_KEY=92cc3531-bc0e-4dc3-a062-a483fda09bb9
166+
export MONGODB_ATLAS_ORG_ID=60d143fb6af7c3005dd8bf05
167+
export TF_ACC=1
168+
```
169+
170+
### Test Connects to Wrong Environment?
171+
```bash
172+
# Check the URL in the error message
173+
# Should see: https://cloud-dev.mongodb.com
174+
# NOT: https://cloud.mongodb.com
175+
176+
# If wrong, environment variable isn't set
177+
source test-dev.env
178+
echo $MONGODB_ATLAS_BASE_URL
179+
```
180+
181+
### Test Skipped?
182+
```bash
183+
# Make sure TF_ACC is set
184+
echo $TF_ACC
185+
# Should output: 1
186+
187+
# If not set:
188+
export TF_ACC=1
189+
```
190+
191+
---
192+
193+
## 📚 Additional Resources
194+
195+
- `TEST_RUN_SUMMARY.md` - Detailed analysis of your test run
196+
- `RUN_ACCEPTANCE_TESTS.md` - Complete testing guide
197+
- `QUICK_TEST_REFERENCE.md` - Quick command reference
198+
- `verify_env.sh` - Environment verification script
199+
- `run_stream_processor_tests.sh` - Automated test runner
200+
201+
---
202+
203+
## ✨ You're Ready!
204+
205+
Your test environment is now properly configured. Start with the basic test:
206+
207+
```bash
208+
source test-dev.env && TF_ACC=1 go test ./internal/service/streamprocessor -run TestAccStreamProcessor_basic -v -timeout 300m
209+
```
210+
211+
Good luck! 🚀
212+

0 commit comments

Comments
 (0)