Skip to content

Commit

Permalink
renaming consumer_analytics for consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
asanzo committed Jan 5, 2023
1 parent 5649a8b commit 0f82af6
Show file tree
Hide file tree
Showing 23 changed files with 18 additions and 20 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ This project contains the following sub-projects:

- **Pilas Bloques API**: REST-API for Pilas Bloques app.
- **Pilas Bloques Analytics**: REST-API for logging Pilas Bloques usage for scientific purposes.
- **Pilas Bloques Analytics Consumer**: Pilas Bloques data users consumer for scientific purposes.
- **Pilas Bloques Consumer**: Pilas Bloques data users consumer for scientific purposes. Consumes data from Pilas Bloques Analytics' database.

## Requisites
- [Nodejs](https://nodejs.org/es/) (v12 >=)
- [MonngoDB](https://www.mongodb.com/). This can be done by running a docker image:
- [MongoDB](https://www.mongodb.com/). This can be done by running a docker image:

Docker run example:
```
Expand All @@ -33,14 +33,14 @@ For development

For production
- Run `npm run build` for make `dist` directory. (TODO)
- Run `npm start:[sub-project]` for server starts. The options are `api`, `anaytics` and `consumer_analytics`
- Run `npm start:[sub-project]` for server starts. The options are `api`, `anaytics` and `consumer`

## Running tests

All tests
- Run `npm test`

If you want to test a specific sub-project, run `npm test:[sub-project]`, with the options: `api`, `analytics` and `consumer_analytics`.
If you want to test a specific sub-project, run `npm test:[sub-project]`, with the options: `api`, `analytics` and `consumer`.

Only one file
- Run `npm test -- -f <FILE_PATH>`
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@
"test:api": "npm run test:api:noTimeout -- --testTimeout 5000",
"test:api:noTimeout": "DOTENV_CONFIG_PATH=./test/api/.env.test jest /test/api --setupFiles dotenv/config --colors --testPathIgnorePatterns dist --runInBand",
"test:analytics": "jest /test/analytics --colors --testPathIgnorePatterns dist --testTimeout 5000 --runInBand",
"test:consumer_analytics": "npm run seed:consumer_analytics && npm run test:consumer_analytics:unit -- --watch",
"test:consumer_analytics:CI": "npm run seed:consumer_analytics && npm run test:consumer_analytics:unit",
"test:consumer_analytics:unit": "DOTENV_CONFIG_PATH=./test/consumer_analytics/.env.test jest --setupFiles dotenv/config --colors --testPathIgnorePatterns dist --testTimeout 5000 --runInBand",
"seed:consumer_analytics": "seed --drop-database --replace-id --set-timestamps --db-name pilas-bloques-consumer-test ./test/consumer_analytics/persistence",
"test:consumer": "npm run seed:consumer && npm run test:consumer:unit -- --watch",
"test:consumer:CI": "npm run seed:consumer && npm run test:consumer:unit",
"test:consumer:unit": "DOTENV_CONFIG_PATH=./test/consumer/.env.test jest --setupFiles dotenv/config --colors --testPathIgnorePatterns dist --testTimeout 5000 --runInBand",
"seed:consumer": "seed --drop-database --replace-id --set-timestamps --db-name pilas-bloques-consumer-test ./test/consumer/persistence",
"start:analytics": "node dist/analytics/index.js",
"start:api": "node dist/api/index.js",
"start:consumer_analytics": "ts-node src/consumer_analytics/index.ts",
"start:consumer": "ts-node src/consumer/index.ts",
"dev": "bash ./scripts/runBackend.sh",
"dev:analytics": "nodemon --watch 'src/analytics/**/*.ts' --ignore 'src/analytics/**/*.spec.ts' --exec 'ts-node' src/analytics/index.ts",
"dev:api": "nodemon --watch 'src/api/**/*.ts' --ignore 'src/api/**/*.spec.ts' --exec 'ts-node' src/api/index.ts",
"dev:consumer_analytics": "nodemon --watch 'src/consumer_analytics/**/*.ts' --ignore 'src/consumer_analytics/**/*.spec.ts' --exec 'ts-node' src/consumer_analytics/index.ts",
"lint": "eslint .",
"prepackage": "rm -Rf dist && npm run build && cp -R node_modules dist/",
"package": "npm run package:api && npm run package:analytics",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import describeDB from './describeDB'
import { solutions } from './1_solutions/solutions'
import analyzer, { reduce, ExperienceByChallenge, finalize } from '../../../src/consumer_analytics/persistence/analyzer'
import analyzer, { reduce, ExperienceByChallenge, finalize } from '../../../src/consumer/persistence/analyzer'
import { CompleteSolution as Solution } from '../../../src/models/solution'
import { Experience } from '../../../src/consumer_analytics/models/experience'
import { Experience } from '../../../src/consumer/models/experience'
import { expectJSON, newExperience, deleteCollection } from '../utils'

describeDB('Analyzer', () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import describeDB from './describeDB'
import analizer from '../../../src/consumer_analytics/persistence/analyzer'
import analizer from '../../../src/consumer/persistence/analyzer'

describeDB('Seed', () => {
test('Running on full db', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sessionBehaviour, { Session } from '../../src/consumer_analytics/models/session'
import sessionBehaviour, { Session } from '../../src/consumer/models/session'
import { newContext, newSolution, unknownSolution as solution } from './utils'
import { CompleteSolution } from '../../src/models/solution'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { StaticAnalysis } from '../../src/models/staticAnalysis'
import trialBehaviour, { Trial } from '../../src/consumer_analytics/models/trial'
import trialBehaviour, { Trial } from '../../src/consumer/models/trial'
import { newTrial, successSolution, failSolution, unknownSolution, newSolution, after, expectIntervalTimestamp } from './utils'
import { staticAnalysis1 } from './experience.spec'

Expand Down
8 changes: 4 additions & 4 deletions test/consumer_analytics/utils.ts → test/consumer/utils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as mongoose from 'mongoose'
import { connectDB } from '../../src/consumer_analytics/persistence/connect'
import { connectDB } from '../../src/consumer/persistence/connect'
import { CompleteSolution as Solution } from '../../src/models/solution'
import { initialize, IntervalTimestamp } from '../../src/consumer_analytics/models/utils'
import trialBehaviour, { Trial } from '../../src/consumer_analytics/models/trial'
import experienceBehaviour, { Experience } from '../../src/consumer_analytics/models/experience'
import { initialize, IntervalTimestamp } from '../../src/consumer/models/utils'
import trialBehaviour, { Trial } from '../../src/consumer/models/trial'
import experienceBehaviour, { Experience } from '../../src/consumer/models/experience'
import { StaticAnalysis } from '../../src/models/staticAnalysis'

// SERVER
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
},
"exclude": [
"test",
"src/consumer_analytics"
]
}

0 comments on commit 0f82af6

Please sign in to comment.