Skip to content

Commit

Permalink
Merge branch 'main' into wagtailcharts-test
Browse files Browse the repository at this point in the history
  • Loading branch information
csebianlander authored Sep 21, 2022
2 parents 13ce245 + 3e7a558 commit 748ec91
Show file tree
Hide file tree
Showing 17 changed files with 325 additions and 230 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,41 +62,6 @@ jobs:
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
CYPRESS_ENVIRONMENT: github
with:
spec: |
test/cypress/integration/admin/admin.cy.js
test/cypress/integration/paying-for-college/repay-student-debt/repay-student-debt.cy.js
test/cypress/integration/data-research/consumer-complaints/consumer-complaints.cy.js
test/cypress/integration/consumer-tools/ask-cfpb/ask-cfpb.cy.js
test/cypress/integration/consumer-tools/find-a-housing-counselor/find-a-housing-counselor.cy.js
test/cypress/integration/consumer-tools/obtener-respuestas/obtener-respuestas.cy.js
test/cypress/integration/consumer-tools//rural-or-underserved-tool/rural-or-underserved-tool.cy.js
test/cypress/integration/consumer-tools/tdp-activity-search/tdp-activity-search.cy.js
test/cypress/integration/consumer-tools/youth-financial-education/survey.cy.js
test/cypress/integration/consumer-tools/youth-financial-education/survey-progress.cy.js
test/cypress/integration/consumer-tools/youth-financial-education/survey-errors.cy.js
test/cypress/integration/consumer-tools/youth-financial-education/modal.cy.js
test/cypress/integration/consumer-tools/youth-financial-education/grade-levels.cy.js
test/cypress/integration/consumer-tools/owning-a-home/owning-a-home.cy.js
test/cypress/integration/consumer-tools/financial-well-being/financial-well-being.cy.js
test/cypress/integration/consumer-tools/before-you-claim/before-you-claim.cy.js
test/cypress/integration/components/global-search/global-search.cy.js
test/cypress/integration/components/footer/footer.cy.js
test/cypress/integration/components/cct-charts/cct-charts.cy.js
test/cypress/integration/components/email-signup/email-signup.cy.js
test/cypress/integration/components/filterable-lists/filterable-lists.cy.js
test/cypress/integration/components/filterable-lists/filter-blog-posts.cy.js
test/cypress/integration/components/header/header.cy.js
test/cypress/integration/components/header/mega-menu.cy.js
test/cypress/integration/components/multiselect/multiselect.cy.js
test/cypress/integration/components/pagination/pagination.cy.js
test/cypress/integration/data-research/prepaid-agreements-search/prepaid-agreements-search.cy.js
test/cypress/integration/data-research/credit-card-agreements-search/credit-card-agreements-search.cy.js
test/cypress/integration/rules-policy/regulations-search.cy.js
test/cypress/integration/paying-for-college/your-financial-path-to-graduation/financial-path-helpers.cy.js
test/cypress/integration/paying-for-college/your-financial-path-to-graduation/financial-path-navigation.cy.js
test/cypress/integration/paying-for-college/your-financial-path-to-graduation/financial-path-program-tests.cy.js
test/cypress/integration/paying-for-college/your-financial-path-to-graduation/financial-path-url-params.cy.js
test/cypress/integration/paying-for-college/your-financial-path-to-graduation/financial-path.cy.js
build: yarn build
start: python cfgov/manage.py runserver 0.0.0.0:8000
wait-on: 'http://localhost:8000'
51 changes: 51 additions & 0 deletions .github/workflows/helm_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: helmlint

on: pull_request

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
helmlint:
- 'helm/**.yaml'
- 'helm/**.tpl'
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.9.2

- uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Set up chart-testing
uses: helm/[email protected]

- name: Set up Helm chart dependencies
id: helm-chart-dependencies
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add elastic https://helm.elastic.co/
helm repo add opensearch https://opensearch-project.github.io/helm-charts/
helm repo update
helm dependency update ./helm/cfgov
- name: Run chart-testing (lint)
run: ct lint --config ct.yaml

- name: Fetch history
run: git fetch --all

- name: Helm template
run: |
helm template testtemplate helm/cfgov
44 changes: 44 additions & 0 deletions cfgov/v1/migrations/0217_add_simple_chart.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions cfgov/v1/models/blog_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class BlogPage(AbstractFilterPage):
"email_signup",
v1_blocks.EmailSignUpChooserBlock(),
),
("simple_chart", organisms.SimpleChart()),
("faq_schema", schema.FAQ(label="FAQ schema")),
("how_to_schema", schema.HowTo(label="HowTo schema")),
]
Expand Down
6 changes: 4 additions & 2 deletions cfgov/v1/models/learn_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,13 @@ class LearnPage(AbstractFilterPage):
("expandable", organisms.Expandable()),
("well", organisms.Well()),
("call_to_action", molecules.CallToAction()),
("video_player", organisms.VideoPlayer()),
("audio_player", organisms.AudioPlayer()),
(
"email_signup",
v1_blocks.EmailSignUpChooserBlock(),
),
("video_player", organisms.VideoPlayer()),
("audio_player", organisms.AudioPlayer()),
("simple_chart", organisms.SimpleChart()),
(
"table_block",
organisms.AtomicTableBlock(table_options={"renderer": "html"}),
Expand Down Expand Up @@ -170,6 +171,7 @@ class DocumentDetailPage(AbstractFilterPage):
("expandable", organisms.Expandable()),
("expandable_group", organisms.ExpandableGroup()),
("notification", molecules.Notification()),
("simple_chart", organisms.SimpleChart()),
(
"table_block",
organisms.AtomicTableBlock(table_options={"renderer": "html"}),
Expand Down
1 change: 1 addition & 0 deletions cfgov/v1/models/story_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class StoryContent(StreamBlock):
info_unit_group = organisms.InfoUnitGroup()
text_introduction = molecules.TextIntroduction()
video_player = organisms.VideoPlayer()
simple_chart = organisms.SimpleChart()


class StoryPage(CFGOVPage):
Expand Down
4 changes: 4 additions & 0 deletions ct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
helm-extra-args: --timeout 600s
chart-dirs:
- helm/
target-branch: main
13 changes: 8 additions & 5 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { defineConfig } = require('cypress')
const { defineConfig } = require( 'cypress' );

module.exports = defineConfig({
module.exports = defineConfig( {
video: false,
screenshotOnRunFailure: false,
fixturesFolder: 'test/cypress/fixtures',
Expand All @@ -15,10 +15,13 @@ module.exports = defineConfig({
baseUrl: 'http://localhost:8000',
specPattern: 'test/cypress/integration/**/*.cy.{js,jsx,ts,tsx}',
supportFile: 'test/cypress/support/e2e.js',
excludeSpecPattern: 'test/cypress/integration/**/*-helpers.cy.js',
excludeSpecPattern: 'test/cypress/integration/**/*-helpers.cy.js'
},
component: {
specPattern: 'test/cypress/component/**/*.cy.{js,jsx,ts,tsx}',
excludeSpecPattern: 'test/cypress/component/**/*-helpers.cy.js',
excludeSpecPattern: 'test/cypress/component/**/*-helpers.cy.js'
},
})
env: {
ENVIRONMENT: 'local-machine'
}
} );
4 changes: 4 additions & 0 deletions docs/functional-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ describe('Consumer Tools', () => {

Overall it lets our tests show what is intended to be happening on a page without showing the more technical side of how we reference and interact with elements.

### Skipping tests

We use the [cypress-skip-test](https://github.com/cypress-io/cypress-skip-test/) plugin to define directly in the spec file under what conditions tests should run. The plugin lets you specify any tests that should not run or should only run in certain environments, on certain browsers, or at certain base URLs. While ideally we want all tests to run everywhere, skipping tests can be handy when you want to merge work-in-progress tests into `main` but skip them in CI/CD pipelines until they work is finished or when you want to temporarily skip a test that's failing while you debug it.

## Creating test data

Wagtail pages can be created programmatically by adding function calls to cfgov/v1/tests/wagtail_pages/create_test_data.py
Expand Down
6 changes: 5 additions & 1 deletion helm/cfgov/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ apiVersion: v2
name: cfgov
description: A Helm chart for Kubernetes

maintainers:
- name: cfpb
email: [email protected]

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
Expand All @@ -15,7 +19,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
version: 0.1.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
7 changes: 4 additions & 3 deletions helm/cfgov/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

#commad:
# commad:
# - "./docker-entrypoint.sh"
#args:
# args:
# - "some arg"

initContainer:
Expand Down Expand Up @@ -198,7 +198,8 @@ cronJobs:
# - name: A_CRONJOB_ENV
# value: "A_CRONJOB_ENV_VALUE"

archive-wagtail-events: # archive cfpb events posted on https://www.consumerfinance.gov/about-us/events/
# archive cfpb events posted on https://www.consumerfinance.gov/about-us/events/
archive-wagtail-events:
schedule: '23 * * * *'
command:
- "django-admin"
Expand Down
Binary file modified test.sql.gz
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
export class FilingInstructionGuide {

url() {
return '/compliance/compliance-resources/small-business-lending/1071-filing-instruction-guide/';
}

open() {
cy.visit( '/compliance/compliance-resources/small-business-lending/1071-filing-instruction-guide/' );
cy.visit( this.url() );
}

toc() {
Expand Down
Loading

0 comments on commit 748ec91

Please sign in to comment.