<commit_before># App Catalog

## Tasks
The App Catalog builds with Node and Grunt. To install them and the App Catalog NPM modules, enter:

```
brew update && brew install node
npm install -g grunt-cli
npm install
```

For a list of tasks enter:
```
grunt --help
```

If you get the error "zsh: command not found: grunt", you may need to add the following line to your .zshrc:
```
PATH=/usr/local/share/npm/bin:$PATH
```

Make sure `NODE_PATH` is set up correctly. You can find the base path by doing `npm list -g`. It should be something like `/usr/local/share/npm/lib`. The `NODE_PATH` will be this base path + `/node_modules`. Add this line to your `~/.zshrc` file:
```
export NODE_PATH=`npm config get prefix`/lib/node_modules
```

## Common Tasks
```
grunt jshint
```
This task will check all app source files for js errors.

```
grunt check
```
This task will run the convention tests for all app source files.

```
grunt watch
```
This task will watch for any css and/or spec file changes and automatically recompile them.

```
grunt build
```
This task will generate a build of the app catalog.

## Running Tests

### Start up Selenium
To run App Catalog tests, the Selenium server environment must be started up:
```
sel
```

This will also make sure webdriver is running.

### Running Tests
App Catalog JavaScript tests can be run by the following command:
```
grunt test
```
This task will run all the Tests/Specs it can find in the `test` directory. If you only want to run a specific test you can enter:
```
grunt test --spec={FileNameSpec}
```
If you would like to run tests or a single test in a dedicated browser with the debug console you'll have to make sure selenium is running and jasmine is running.

### Installing ChromeDriver
If you do not have ChromeDriver installed, your test runs will fail with the error:
```
The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver
```
If this happens, you will need to run:
```
brew install chromedriver
```

### Running Tests Faster
By starting up a Jasmine file server once, tests can run without as much overhead for setting up the tests.

To start Jasmine server:
```
grunt test:server
```
Jasmine defaults to port 8890.

To pick tests to run enter:
```
grunt test:conf --spec={FileNameSpec}
```

Now that you have all these services running you can go to [http://localhost:5445/wd/hub/](http://localhost:5445/wd/hub/). You will be presented with a list of browser sessions. You can create a new session - once loaded click on the `Load Script` button and type in `localhost:8890/`. This should point the browser instance to the Jasmine test suite you previously set up. You can now debug and refresh.

## Developing for ALM
The App Catalog is now a dependency in ALM and is defined in `build/js_dependencies.rb` as a nexus artifact. The artifact is named `app-catalog`. This is how the build servers pull in the App Catalog. If you need real-time updates of App Catalog files in ALM, you'll have to start Jetty using the environment variable `APP_CATALOG_PATH`. The default location for this path is `~/projects/app-catalog`. For example:
```
APP_CATALOG_PATH=~/projects/app-catalog buildr jetty:run
```
This will start up Jetty and tell it to use the files directly from the App Catalog for development, including CSS generation.

If you have made modifications to the ALM Java files, you may need to run
```
APP_CATALOG_PATH=~/projects/app-catalog buildr clean jetty:run
```

### Running on-demand-guitests without a push to either repository
Before the App Catalog was in a separate repository, you could change ALM and the App Catalog, do a local commit and push to ondemand. Now that the App Catalog is in a separate repository the process changes slightly, but doesn't need to require a push.
<commit_msg>Added APPSDK_PATH to documentation<commit_after># App Catalog

## Tasks
The App Catalog builds with Node and Grunt. To install them and the App Catalog NPM modules, enter:

```
brew update && brew install node
npm install -g grunt-cli
npm install
```

For a list of tasks enter:
```
grunt --help
```

If you get the error "zsh: command not found: grunt", you may need to add the following line to your .zshrc:
```
PATH=/usr/local/share/npm/bin:$PATH
```

Make sure `NODE_PATH` is set up correctly. You can find the base path by doing `npm list -g`. It should be something like `/usr/local/share/npm/lib`. The `NODE_PATH` will be this base path + `/node_modules`. Add this line to your `~/.zshrc` file:
```
export NODE_PATH=`npm config get prefix`/lib/node_modules
```

## Common Tasks
```
grunt jshint
```
This task will check all app source files for js errors.

```
grunt check
```
This task will run the convention tests for all app source files.

```
grunt watch
```
This task will watch for any css and/or spec file changes and automatically recompile them.

```
grunt build
```
This task will generate a build of the app catalog.

## Running Tests

### Start up Selenium
To run App Catalog tests, the Selenium server environment must be started up:
```
sel
```

This will also make sure webdriver is running.

### Running Tests
App Catalog JavaScript tests can be run by the following command:
```
grunt test
```
This task will run all the Tests/Specs it can find in the `test` directory. If you only want to run a specific test you can enter:
```
grunt test --spec={FileNameSpec}
```
If you would like to run tests or a single test in a dedicated browser with the debug console you'll have to make sure selenium is running and jasmine is running.

### Installing ChromeDriver
If you do not have ChromeDriver installed, your test runs will fail with the error:
```
The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver
```
If this happens, you will need to run:
```
brew install chromedriver
```

### Running Tests Faster
By starting up a Jasmine file server once, tests can run without as much overhead for setting up the tests.

To start Jasmine server:
```
grunt test:server
```
Jasmine defaults to port 8890.

To pick tests to run enter:
```
grunt test:conf --spec={FileNameSpec}
```

### Running Tests Against Local App SDK Changes
Generate the jasmine test config pointing at local files:
```
APPSDK_PATH=~/projects/appsdk grunt test:conf [--spec={FileNameSpec}]
```
Start the server:
```
APPSDK_PATH=~/projects/appsdk grunt test:server

Now that you have all these services running you can go to [http://localhost:5445/wd/hub/](http://localhost:5445/wd/hub/). You will be presented with a list of browser sessions. You can create a new session - once loaded click on the `Load Script` button and type in `localhost:8890/`. This should point the browser instance to the Jasmine test suite you previously set up. You can now debug and refresh.

## Developing for ALM
The App Catalog is now a dependency in ALM and is defined in `build/js_dependencies.rb` as a nexus artifact. The artifact is named `app-catalog`. This is how the build servers pull in the App Catalog. If you need real-time updates of App Catalog files in ALM, you'll have to start Jetty using the environment variable `APP_CATALOG_PATH`. The default location for this path is `~/projects/app-catalog`. For example:
```
APP_CATALOG_PATH=~/projects/app-catalog buildr jetty:run
```
This will start up Jetty and tell it to use the files directly from the App Catalog for development, including CSS generation.

If you have made modifications to the ALM Java files, you may need to run
```
APP_CATALOG_PATH=~/projects/app-catalog buildr clean jetty:run
```

### Running on-demand-guitests without a push to either repository
Before the App Catalog was in a separate repository, you could change ALM and the App Catalog, do a local commit and push to ondemand. Now that the App Catalog is in a separate repository the process changes slightly, but doesn't need to require a push.

{'fraction_non_alphanumeric': 0.08170096702206794, 'fraction_numerical': 0.003967270022315894, 'mean_word_length': 4.282907662082515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5463427', 'n_tokens_mistral': 2370, 'n_tokens_neox': 2179, 'n_words': 1199}