Update workflow

This commit is contained in:
zandercymatics 2023-11-29 13:15:11 -07:00
parent 98aa1c11c8
commit 5b49602684
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 11 additions and 7 deletions

View file

@ -66,20 +66,20 @@ jobs:
CF_PASSWORD: CF_{{ needs.variables.outputs.environment }}_PASSWORD
steps:
- name: Generate current-federal.csv
uses: 18f/cg-deploy-action@main
uses: cloud-gov/cg-cli-tools@main
with:
cf_username: ${{ secrets[env.CF_USERNAME] }}
cf_password: ${{ secrets[env.CF_PASSWORD] }}
cf_org: cisa-dotgov
cf_space: ${{ needs.variables.outputs.environment }}
full_command: "cf run-task getgov-${{ needs.variables.outputs.environment }} --command 'python manage.py generate_current_federal_report' --name federal"
cf_command: "run-task getgov-${{ needs.variables.outputs.environment }} --command 'python manage.py generate_current_federal_report' --name federal"
- name: Generate current-full.csv
uses: 18f/cg-deploy-action@main
uses: cloud-gov/cg-cli-tools@main
with:
cf_username: ${{ secrets[env.CF_USERNAME] }}
cf_password: ${{ secrets[env.CF_PASSWORD] }}
cf_org: cisa-dotgov
cf_space: ${{ needs.variables.outputs.environment }}
full_command: "cf run-task getgov-${{ needs.variables.outputs.environment }} --command 'python manage.py generate_current_full_report' --name full"
cf_command: "run-task getgov-${{ needs.variables.outputs.environment }} --command 'python manage.py generate_current_full_report' --name full"

View file

@ -9,7 +9,7 @@ from registrar.utility.csv_export import export_domains_to_writer
from django.core.management import call_command
from unittest.mock import call, mock_open, patch
from api.views import get_current_federal, get_current_full
import boto3_mocking # type: ignore
class CsvReportsTest(TestCase):
"""Tests to determine if we are uploading our reports correctly"""
@ -84,6 +84,7 @@ class CsvReportsTest(TestCase):
error = err.exception
self.assertEqual(str(error), "Could not find newly created file at 'migrationdata/current-full.csv'")
@boto3_mocking.patching
def test_generate_federal_report(self):
"""Ensures that we correctly generate current-federal.csv"""
expected_file_content = [
@ -100,6 +101,7 @@ class CsvReportsTest(TestCase):
# Now you can make assertions about how you expect 'file' to be used.
content.write.assert_has_calls(expected_file_content)
@boto3_mocking.patching
def test_generate_full_report(self):
"""Ensures that we correctly generate current-full.csv"""
expected_file_content = [
@ -135,6 +137,7 @@ class CsvReportsTest(TestCase):
# Check that the response body contains "File not found"
self.assertEqual(response.content.decode(), "File not found")
@boto3_mocking.patching
def test_load_federal_report(self):
"""Tests the current-federal api link"""
request = self.factory.get("/fake-path")
@ -152,6 +155,7 @@ class CsvReportsTest(TestCase):
self.assertEqual(file_content, expected_file_content)
@boto3_mocking.patching
def test_load_full_report(self):
"""Tests the current-federal api link"""
request = self.factory.get("/fake-path")