Skip to content

Commit

Permalink
Siivottu cljs pois, pakettipäivityksiä, ci testit uutta fronttia vasten
Browse files Browse the repository at this point in the history
  • Loading branch information
hajoa committed Feb 25, 2025
1 parent 50d37fd commit dca3ebf
Show file tree
Hide file tree
Showing 93 changed files with 3,496 additions and 12,065 deletions.
8 changes: 1 addition & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,8 @@ module.exports = {
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/ban-types': [
'@typescript-eslint/no-empty-object-type': [
'error',
{
types: {
object: false,
},
extendDefaults: true,
},
],
'@typescript-eslint/array-type': [
'error',
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
/maksut.ipr
.clj-kondo/
.open-next
/test-results/
*.swp
**/test-results/
*.swp
**/.npmrc
22 changes: 6 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
NODE_MODULES = node_modules
PM2 = PM2_HOME=.pm2 npx pm2
DOCKER_COMPOSE=COMPOSE_PARALLEL_LIMIT=8 $(if $(DOCKER_SUDO),sudo )docker compose

$(NODE_MODULES): package.json package-lock.json
npm ci
touch $(NODE_MODULES)

start-docker:
@$(DOCKER_COMPOSE) up -d maksut-nginx-local

Expand All @@ -18,8 +13,7 @@ start-docker-local:
@$(DOCKER_COMPOSE) up -d maksut-mailcatcher-local
@$(DOCKER_COMPOSE) up -d maksut-wiremock-local

start-docker-test:
@$(DOCKER_COMPOSE) up -d maksut-nginx-local
start-docker-test: start-docker-local
@$(DOCKER_COMPOSE) up -d maksut-e2e-db-local

kill-docker:
Expand All @@ -28,27 +22,24 @@ kill-docker:
kill-docker-test:
@$(DOCKER_COMPOSE) kill maksut-e2e-db-local

start: $(NODE_MODULES) start-docker
@$(PM2) start pm2.config.js --only maksut-frontend
start: start-docker
@$(PM2) start pm2.config.js --only maksut-backend

start-local: $(NODE_MODULES) start-docker-local
@$(PM2) start pm2.config.js --only maksut-frontend
start-local: start-docker-local
@$(PM2) start pm2.config.js --only maksut-backend

log: $(NODE_MODULES)
log:
@$(PM2) logs --timestamp

logs: log

status: $(NODE_MODULES)
status:
@$(PM2) status

kill: $(NODE_MODULES) kill-docker
kill: kill-docker
@$(PM2) kill

start-test: start-docker-test
@$(PM2) start pm2.config.js --only maksut-frontend
@$(PM2) start pm2.config.js --only maksut-backend-test

kill-test: kill-docker-test
Expand All @@ -60,5 +51,4 @@ restart-test: kill-test start-test

reload:
@$(PM2) kill
@$(PM2) start pm2.config.js --only maksut-frontend
@$(PM2) start pm2.config.js --only maksut-backend
39 changes: 23 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* [Swagger](#swagger)
* [Testien ajaminen](#testien-ajaminen)
* [Lint](#lint)
* [Clojure(Script) -tiedostojen lint](#clojurescript--tiedostojen-lint)
* [Clojure -tiedostojen lint](#clojure--tiedostojen-lint)
* [REPL-yhteys palvelimeen ja selaimeen](#repl-yhteys-palvelimeen-ja-selaimeen)
* [Palvelun paikalliset osoitteet](#palvelun-paikalliset-osoitteet)
* [Tuotantokäyttö](#tuotantokäyttö)
Expand Down Expand Up @@ -82,13 +82,6 @@ Paytrail-flowta voi kehittää/testata lokaalilla kannalla seuraavilla askelilla

7. Tapahtuman tuloksena lähetetyt mailit voi katsoa Mailcatcherista osoitteesta: http://localhost:1080/.


8. Käyttöliittymätestit voi ajaa lokaalia kehitysympäristöä ja Paytrailia vasten komennolla:

```bash
WITH_PAYTRAIL=TRUE npx playwright test
```

## Palvelun ajaminen paikallisesti testiympäristöä vasten

Kloonaa ja valmistele omien ohjeiden mukaan käyttökuntoon [local-environment](https://github.com/Opetushallitus/local-environment) -ympäristö.
Expand Down Expand Up @@ -239,7 +232,7 @@ Swagger JSON löytyy polusta `/maksut/swagger.json`

### Lint

#### Clojure(Script) -tiedostojen lint
#### Clojure -tiedostojen lint

```sh
npm run lint:clj
Expand All @@ -259,6 +252,27 @@ Aja sen jälkeen lein testit käyttäen lokaalia konfiguraatiotiedostoa:
CONFIG=oph-configuration/config.test.local-environment.edn lein test
```

### Playwrigth käyttöliittymätestit

Käynnistä backend kuten backend-testejä varten, sekä käyttöliittymä

```bash
cd src/maksut-ui
npm run test
```

Käynnistä testit (avaa käyttöliittymä lisäämällä --ui flag)

```bash
npx playwright test
```

Oikeaa Paytrailia vasten komennolla:

```bash
WITH_PAYTRAIL=TRUE npx playwright test
```

## REPL-yhteys palvelimeen ja selaimeen

REPL-yhteys palvelimelle avautuu sanomalla komentorivillä
Expand All @@ -267,16 +281,9 @@ REPL-yhteys palvelimelle avautuu sanomalla komentorivillä
lein repl :connect localhost:9034
```

REPL-yhteys selaimeen avautuu sanomalla em. REPL-yhteyden sisällä. Muistathan ensin avata selaimellasi palvelun (ks. osoite alta).

```clj
(shadow.cljs.devtools.api/nrepl-select :maksut)
```

## Palvelun paikalliset osoitteet

* Palvelun osoite: (http://localhost:9099/maksut)
* Palvelun Shadow CLJS -palvelimen osoite (http://localhost:9630)

## Tuotantokäyttö

Expand Down
15 changes: 10 additions & 5 deletions bin/cibuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@ test-lein() {
lein test
}

test-e2e() {
cd src/maksut-ui
npm run test-ci
cd -
}

run-all-tests() {
lint \
&& run-mocked-maksut \
&& test-lein
&& test-lein \
&& test-e2e
}

create-uberjar() {
Expand All @@ -34,10 +41,8 @@ run-mocked-maksut() {
}

run-all-tests-and-create-uberjar() {
lint \
&& create-uberjar \
&& run-mocked-maksut \
&& test-lein
run-all-tests \
&& create-uberjar
}

COMMAND=$1
Expand Down
18 changes: 2 additions & 16 deletions oph-configuration/clj-kondo.config.edn
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
{:lint-as {day8.re-frame.tracing/defn-traced clojure.core/defn
day8.re-frame.tracing/fn-traced clojure.core/fn}
:linters {:unresolved-symbol {:exclude [(compojure.api.sweet/context)
{:linters {:unresolved-symbol {:exclude [(compojure.api.sweet/context)
(clojure.java.jdbc/with-db-transaction)
goog.DEBUG]}
:unused-namespace {:exclude [cljs.repl]}
:unused-referred-var {:exclude {cljs.repl [Error->map
apropos
dir
doc
error->str
ex-str
ex-triage
find-doc
print-doc
pst
source]}}}}
goog.DEBUG]}}}
1 change: 0 additions & 1 deletion oph-configuration/config.dev.edn
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@
:oppija-baseurl "http://localhost:3000/maksut-ui"}
:oph-organisaatio-oid "1.2.246.562.10.00000000001"
:public-config {:environment :development
:default-panel :panel/tutu-maksut
:caller-id "1.2.246.562.10.00000000001.maksut.frontend"}}
1 change: 0 additions & 1 deletion oph-configuration/config.edn.template
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@
:oppija-baseurl "{{ maksut_oppija_base_url }}"}
:oph-organisaatio-oid "1.2.246.562.10.00000000001"
:public-config {:environment {{ maksut_environment | default(':development') }}
:default-panel :panel/tutu-maksut
:caller-id "{{ maksut_frontend_caller_id | default('1.2.246.562.10.00000000001.maksut.frontend')}}"}}
3 changes: 1 addition & 2 deletions oph-configuration/config.test.github.edn
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
:session-cookie-name "JSESSIONID"}}}
:urls {:virkailija-baseurl "http://localhost"
:maksut-url "http://localhost:19033/maksut"
:oppija-baseurl "http://localhost:3000/maksut-ui"}
:oppija-baseurl "http://localhost:3003/maksut-ui"}
:oph-organisaatio-oid "1.2.246.562.10.00000000001"
:public-config {:environment :it
:default-panel :panel/tutu-maksut
:caller-id "1.2.246.562.10.00000000001.maksut.frontend"}}
3 changes: 1 addition & 2 deletions oph-configuration/config.test.local-environment.edn
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
:session-cookie-name "JSESSIONID"}}}
:urls {:virkailija-baseurl "http://localhost"
:maksut-url "http://localhost:19033/maksut"
:oppija-baseurl "http://localhost:3000/maksut-ui"}
:oppija-baseurl "http://localhost:3003/maksut-ui"}
:oph-organisaatio-oid "1.2.246.562.10.00000000001"
:public-config {:environment :it
:default-panel :panel/tutu-maksut
:caller-id "1.2.246.562.10.00000000001.maksut.frontend"}}
Loading

0 comments on commit dca3ebf

Please sign in to comment.