Skip to content
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

Updating makefile commands #1226

Merged
merged 29 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
236e613
add single schema validation and the option to run a single functiona…
VirajP1002 Oct 6, 2023
2d9f79d
Allow lint and tests to be run in one command for Python and JS
VirajP1002 Oct 9, 2023
5e41b3c
Allow functional tests to be run headless
VirajP1002 Oct 9, 2023
cb8a25f
allow dev folders such as venv and contents of gitignore to be ignore…
VirajP1002 Oct 9, 2023
7d4069d
allow a chosen suite to be run
VirajP1002 Oct 9, 2023
09868d5
Exclude venv and tests directory to ensure python lint runs without e…
VirajP1002 Oct 9, 2023
8f08609
add a command that runs JS lint and test headless and made commands n…
VirajP1002 Oct 9, 2023
773875a
Rename the commands to clarify the order of linting and testing when …
VirajP1002 Oct 10, 2023
2cc7a4c
Add extra commands README that developers can utilise
VirajP1002 Oct 10, 2023
e4cc07a
Remove venv from being ignored
VirajP1002 Oct 12, 2023
13dd758
Refactor commands to clarify the purpose and to ensure consistency in…
VirajP1002 Oct 12, 2023
cd82cf6
Alter commands that developers find useful
VirajP1002 Oct 13, 2023
ad1995b
Improve the description of commands used for functional tests
VirajP1002 Oct 13, 2023
747fbbe
Fix config and ignore files
VirajP1002 Oct 13, 2023
5f52cbb
Replace yarn commands with make commands
VirajP1002 Oct 18, 2023
84f2827
Update the file to make use of the new Make commands
VirajP1002 Oct 18, 2023
f35709f
Add new commands to generate pages and to generate new specs given a …
VirajP1002 Oct 18, 2023
5f6718e
Replace yarn commands with Make commands
VirajP1002 Oct 18, 2023
b990caf
Refactor issues with running make commands
VirajP1002 Oct 18, 2023
46366ba
Remove incorrect pipenv commands
VirajP1002 Oct 18, 2023
097688d
Clarify which suites are available to run using the test-functional-s…
VirajP1002 Oct 18, 2023
a8bc253
Correct the make commands to ensure the PR tests pass correctly
VirajP1002 Oct 18, 2023
e1faa36
Update commands to use yarn commands directly rather than shell scripts
VirajP1002 Oct 19, 2023
8edd918
Remove --suite from generate_pages command
VirajP1002 Oct 19, 2023
989e944
Temporary error to test if pullrequest.yml works as intended
VirajP1002 Oct 19, 2023
f9c8ea6
Correct deliberate error to ensure pullrequest.yml works as intended
VirajP1002 Oct 19, 2023
e9c6c94
Delete unused file
VirajP1002 Oct 19, 2023
4e54aad
Merge branch 'main' into updating-makefile-commands
VirajP1002 Oct 19, 2023
5d8e0e0
Remove the .json to be required when validating a single schema
VirajP1002 Oct 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
tests/functional/generated_pages/
# Exclude generated_pages directory
tests/functional/generated_pages/
27 changes: 23 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SCHEMAS_VERSION=`cat .schemas-version`
DESIGN_SYSTEM_VERSION=`cat .design-system-version`
RUNNER_ENV_FILE?=.development.env
SCHEMA_PATH=./schemas/test/en/

clean:
find schemas/* -prune | grep -v "schemas/test" | xargs rm -r
Expand All @@ -16,14 +17,14 @@ load-design-system-templates:

build: load-design-system-templates load-schemas translate

lint: lint-python
yarn lint
lint: lint-python lint-js

lint-python:
pipenv run ./scripts/run_lint_python.sh

format: format-python
yarn format
lint-test-python: lint-python test-unit

format: format-python format-js

format-python:
pipenv run isort .
Expand All @@ -38,9 +39,27 @@ test-unit:
test-functional:
pipenv run ./scripts/run_tests_functional.sh

test-functional-headless:
EQ_RUN_FUNCTIONAL_TESTS_HEADLESS='True' pipenv run ./scripts/run_tests_functional.sh

test-functional-spec:
yarn test_functional --spec ./tests/functional/spec/$(SPEC)

test-functional-suite:
yarn test_functional --suite $(SUITE)

lint-js:
yarn lint

format-js:
yarn format

validate-test-schemas:
pipenv run ./scripts/validate_test_schemas.sh

validate-test-schema:
pipenv run ./scripts/validate_test_schemas.sh $(SCHEMA_PATH)$(SCHEMA)

translation-templates:
pipenv run python -m scripts.extract_translation_templates

Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,16 @@ RUNNER_ENV_FILE=.functional-tests.env make run

This will set the correct environment variables for running the functional tests.

Then you can run:
Then you can run either:

``` shell
make test-functional
```
or

``` shell
make test-functional-headless
```

This will delete the `tests/functional/generated_pages` directory and regenerate all the files in it from the schemas.

Expand All @@ -256,7 +261,6 @@ yarn generate_pages
yarn test_functional
```


To generate the pages manually you can run the `generate_pages` scripts with the schema directory. Run it from the `tests/functional` directory as follows:

``` shell
Expand All @@ -278,7 +282,7 @@ yarn test_functional
This can be limited to a single spec using:
MebinAbraham marked this conversation as resolved.
Show resolved Hide resolved

``` shell
yarn test_functional --spec ./tests/functional/spec/exit.spec.js
make test-functional-spec SPEC=<spec>
MebinAbraham marked this conversation as resolved.
Show resolved Hide resolved
```

To run a single test, add `.only` into the name of any `describe` or `it` function:
Expand All @@ -291,7 +295,7 @@ Test suites are configured in the `wdio.conf.js` file.
An individual test suite can be run using:
MebinAbraham marked this conversation as resolved.
Show resolved Hide resolved

``` shell
yarn test_functional --suite <suite>
make test-functional-suite SUITE=<suite>
```

To run the tests against a remote deployment you will need to specify the environment variable of EQ_FUNCTIONAL_TEST_ENV eg:
Expand Down
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ filterwarnings=
ignore:.*formatargspec.*:DeprecationWarning
ignore:.*isAlive.*:PendingDeprecationWarning

[flake8]
# Ignore node_modules and cloned repos when not in a virtual environment
exclude = node_modules/*,tests/*,src/*
max-line-length = 160
ignore = C815,C816,W503,E203
5 changes: 0 additions & 5 deletions tox.ini

This file was deleted.