Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions docs/contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ guide](https://support.mozilla.org/en-US/get-involved) on the SUMO site.

# Help reporting bugs

Please report any bugs you find with Kitsune on Bugzilla:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bugzilla should remain the tracking source for any reported bugs. The sumo repo is used mainly for internal organizational purposes

<https://bugzilla.mozilla.org/enter_bug.cgi?product=support.mozilla.org>
Please report any bugs you find with Kitsune in the Sumo repository:
<https://github.com/mozilla/sumo/issues>

# Help with hacking!

First step is to [set up Kitsune](hacking_howto.md "hacking howto") so you can run it and hack on it.
If you have problems, please [let us know](contactus.md "contact us")!
First step is to [set up Kitsune](hacking_howto.md) so you can run it and hack on it.
If you have problems, please [let us know](contactus.md)!

# Help with making Kitsune easier for hacking on!

Expand All @@ -42,5 +42,5 @@ We're working on making Kitsune easier to hack on. This entails:
Kitsune

Any thoughts you have on making this easier are much appreciated.
Further, if you could help us, that\'d be valuable to us and all those
who follow in your footsteps.
Further, if you could help us, that'd be valuable to us and all those
who follow in your footsteps.
46 changes: 23 additions & 23 deletions docs/hacking_howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This chapter helps you get an installation of Kitsune up and running.

If you have any problems getting Kitsune running, let us know. See [Contact us](contactus.md).
If you have any problems getting Kitsune running, [let us know](contactus.md).

## Getting up and running

Expand Down Expand Up @@ -51,11 +51,11 @@ and follow the following steps.
The running instance will be located at http://localhost:8000/ unless you specified otherwise,
and the administrative control panel will be at http://localhost:8000/admin/.

Another way you might choose to run the app (step 3 above) is by getting a shell in the container and then manually
Another way you might choose to run the app (instead of step 4 above) is by getting a shell in the container and then manually
running the Django dev server from there. This should make frequent restarts of the server a lot
faster and easier if you need to do that:

```
```sh
make runshell
./manage.py runserver 0.0.0.0:8000
```
Expand All @@ -82,20 +82,20 @@ After the above you can do some optional steps if you want to use the admin:

- Enable the admin control panel

```
```sh
echo "ENABLE_ADMIN=True" >> .env
```

- Create a superuser

```
docker-compose exec web ./manage.py createsuperuser
```sh
docker compose exec web ./manage.py createsuperuser
```

- Create a profile for this user

```
docker-compose exec web ./manage.py shell_plus
```sh
docker compose exec web ./manage.py shell_plus
In [1]: u = User.objects.get(username="superuser")
In [2]: Profile(user=u).save()
```
Expand All @@ -109,8 +109,8 @@ add `ENABLE_DEV_LOGIN=True` to your `.env` file.

You can create a normal user like so:

```
docker-compose exec web ./manage.py shell_plus
```sh
docker compose exec web ./manage.py shell_plus
In [1]: u = User(username="foobar")
In [2]: u.save()
In [3]: Profile(user=u).save()
Expand All @@ -123,8 +123,8 @@ You can then log in as that user by visiting: `http://localhost:8000/user/foobar
We include some sample data to get you started. You can install it by
running this command:

```
docker-compose exec web ./manage.py generatedata
```sh
docker compose exec web ./manage.py generatedata
```

### Get AAQ working
Expand Down Expand Up @@ -163,18 +163,18 @@ or have entered data yourself through the admin interface.

1. Enter into the web container

```shell
docker-compose exec web bash
```sh
docker compose exec web bash
```

2. Build the indicies

```bash
```sh
./manage.py es_init && ./manage.py es_reindex
```

3. Now, exit from web's bash shell
```bash
```sh
exit
```

Expand All @@ -191,13 +191,13 @@ Install it globally,
or in a venv,
outside of the docker container with:

```bash
```sh
pip install pre-commit
```

Then set up its git pre-commit hook:

```bash
```sh
pre-commit install
```

Expand All @@ -206,14 +206,14 @@ every time you commit,
pre-commit will check your changes for style problems.
To run it manually you can use the command:

```bash
```sh
pre-commit run
```

which will run the checks for only your changes,
or if you want to run the lint checks for all files:

```bash
```sh
pre-commit run --all-files
```

Expand All @@ -227,8 +227,8 @@ For more details see the [pre-commit docs](https://pre-commit.com).
JSON files containing historical Firefox version data and write them
within its package directory. To set this up, run this command to do
the initial fetch:
```bash
docker-compose exec web ./manage.py update_product_details
```sh
docker compose exec web ./manage.py update_product_details
```

### Using Django Debug Toolbar
Expand All @@ -248,7 +248,7 @@ USE_DEBUG_TOOLBAR=True

Running the test suite is easy:

```bash
```sh
./bin/run-unit-tests.sh
```

Expand Down
15 changes: 7 additions & 8 deletions docs/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ title: All about testing


Kitsune has a fairly comprehensive Python test suite. Changes should not
break tests\-\--only change a test if there is a good reason to change
the expected behavior\-\--and new code should come with tests.
break testsonly change a test if there is a good reason to change
the expected behaviorand new code should come with tests.

# Running the Test Suite

If you followed the steps in `the installation docs
<hacking_howto>`{.interpreted-text role="any"}, then you should be all
set setup-wise.
If you followed the steps in [the installation docs](hacking_howto.md),
then you should be all set setup-wise.

To run the tests, you need to do:

Expand Down Expand Up @@ -129,13 +128,13 @@ Frontend JavaScript is currently tested with
To run tests, make sure you have have the NPM dependencies installed,
and then run:

$ npm run webpack:test
npm run webpack:test

## Writing JavaScript Tests

Mocha tests are discovered using the pattern
`kitsune/*/static/*/js/tests/**/*.js`. That means that any app can have
a [tests]{.title-ref} directory in its JavaScript directory, and the
a `tests` directory in its JavaScript directory, and the
files in there will all be considered test files. Files that don't
define tests won't cause issues, so it is safe to put testing utilities
in these directories as well.
Expand All @@ -144,7 +143,7 @@ Here are a few tips for writing tests:

- Any HTML required for your test should be added by the tests or a
`beforeEach` function in that test suite. React is useful for this.
- You can use [sinon]{.title-ref} to mock out parts of libraries or
- You can use `sinon` to mock out parts of libraries or
functions under test. This is useful for testing AJAX.
- The tests run in a Node.js environment. A browser environment can be
simulated using `jsdom`.