-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
regression testing? #2
Comments
Hey @BigBaIIs, Regression testing for this This process would include re-running a suite of test cases that check core features: executing default queries to fetch PDF links, validating output file generation (e.g., For example, after adding pagination, regression tests would confirm that the script still retrieves the expected number of PDFs from a single page of results (15 by default) and doesn’t crash with duplicate URLs, while also verifying that the Automated tests could use mock search results and HTTP responses to simulate network behavior, ensuring stability across Python versions and environments, with manual spot-checks to validate real-world PDF discovery remains consistent with prior versions. 6PM EST works. Please call on personal Zoom. |
was going to suggest we use ngrok since ngrok typically tunnels to a local server, but for dod_spending.py, we’ll proxy HTTP requests outbound. Since the script makes requests to external sites (not a local server), we’ll need a proxy server to route traffic through ngrok. |
NB @BigBaIIs, You and I can adapt it for Unlike its usual inbound use case, where ngrok forwards external traffic to a local service, this script makes requests to external sites (e.g., Google search, government domains) rather than hosting a local server. |
this adds context about why government servers (*.gov) pose unique challenges—security policies, IP restrictions, and SSL quirks. good idea dude |
Hey @BigBaIIs, Made this table to leave here. I don't think it belongs in the official DoD Spend documentation. Essentially we'd want to run: ngrok authtoken YOUR_AUTH_TOKEN && ngrok http 8080 --background This would help debug issues with government server responses (e.g., 429 rate limits). Pair with Check the table out below:
Something to note that, in particular Government servers take commands like |
Hi @BigBaIIs, Yeah I ran cursory tests on ![]()
![]()
server {
listen 443 ssl;
server_name dogegov.com;
ssl_certificate /etc/letsencrypt/live/dogegov.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/dogegov.com/privkey.pem;
location / {
proxy_pass http://localhost:3000;
}
}
server {
listen 80;
server_name dogegov.com;
return 301 https://$host$request_uri;
} Setting up also IPv4/IPv6 denying via compatibility in rate limiting: location / {
deny 192.168.1.100; # Block specific IP
if ($http_user_agent ~* "badbot|spider") {
return 403;
}
proxy_pass http://localhost:3000;
} Final thing was caching a static response this is basically like Argo trafficking: proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=dogecache:10m inactive=24h;
server {
listen 80;
server_name doge.gov;
location / {
proxy_cache dogecache;
proxy_cache_valid 200 301 302 1h;
proxy_pass http://localhost:3000;
}
} You may need to edit the proxy headers @BigBaIIs, depending on Cheers, |
@Montana @BigBaIIs you can use the ngrok python SDK with this to make the testing faster without having to download the binary and running CLI commands: ngrok-python-sdk |
Hey @shubcodes, Thank you for the recommendation - it may be something I do in a sandbox, as far as I know though the CLI and binary offer full access to I think ultimately the Python SDK ( I think one thing @BigBaIIs's and I talked about was dependency bloat, via installing In other terms, |
def need less deps on this laptop, 8TB isn't doing it anymore even |
should be able to use nginx-reverse-proxy fairly easy server {
listen 80;
server_name localhost;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
} once the configuration is right (if using sites-available), then symlink sudo ln -s /etc/nginx/sites-available/myapp /etc/nginx/sites-enabled/ |
hit a grand slam, oh just in time for time for brekky |
yo @Montana
anything planned for this? lmk we can zoom it after 6PM EST.
The text was updated successfully, but these errors were encountered: