Skip to content

Commit

Permalink
rename assets folder
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
  • Loading branch information
JorTurFer committed Jun 27, 2022
1 parent 3dae30b commit d32b9b0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 176 deletions.
10 changes: 5 additions & 5 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
### All tests

```bash
go test -v assets/setup_test.go # Only needs to be run once.
go test -v utils/setup_test.go # Only needs to be run once.
go test -v ./scalers_go/...
go test -v assets/cleanup_test.go # Skip if you want to keep testing.
go test -v utils/cleanup_test.go # Skip if you want to keep testing.
```

### Specific test
Expand All @@ -26,15 +26,15 @@ Refer to [this](https://pkg.go.dev/testing) for more information about testing i

The test script will run in 3 phases:

- **Setup:** This is done in [`assets/setup_test.go`](assets/setup_test.go). If you're adding any tests to the KEDA install / setup process, you need to add it to this file. `assets/setup_test.go` deploys KEDA to the `keda` namespace, updates the image to
- **Setup:** This is done in [`utils/setup_test.go`](utils/setup_test.go). If you're adding any tests to the KEDA install / setup process, you need to add it to this file. `utils/setup_test.go` deploys KEDA to the `keda` namespace, updates the image to
`kedacore/keda:main`.

After `assets/setup_test.go` is done, we expect to have KEDA setup in the `keda` namespace.
After `utils/setup_test.go` is done, we expect to have KEDA setup in the `keda` namespace.

- **Tests:** Currently there are only scaler tests in `tests/scalers_go/`. Each test is kept in its own package. This is to prevent conflicting variable declarations for commoly used variables (**ex -** `testNamespace`). Individual scaler tests are run
in parallel, but tests within a file can be run in parallel or in series. More about tests below.

- **Global cleanup:** This is done in [`assets/cleanup_test.go`](assets/cleanup_test.go). It cleans up all the resources created in `assets/setup_test.go`.
- **Global cleanup:** This is done in [`utils/cleanup_test.go`](utils/cleanup_test.go). It cleans up all the resources created in `utils/setup_test.go`.

## Adding tests

Expand Down
34 changes: 0 additions & 34 deletions tests/assets/cleanup_test.go

This file was deleted.

132 changes: 0 additions & 132 deletions tests/assets/setup_test.go

This file was deleted.

6 changes: 3 additions & 3 deletions tests/run-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ counter=0
executed_count=0

function run_setup {
go test -v -tags e2e assets/setup_test.go
go test -v -tags e2e utils/setup_test.go
}

function run_tests {
counter=0
# randomize tests order using shuf
# TODO - Remove TypeScript regex after all tests have been migrated to Go.
for test_case in $(find . -not -path '*/assets/*' -wholename "$E2E_REGEX_GO" -o -wholename "$E2E_REGEX_TS" | shuf)
for test_case in $(find . -not -path '*/utils/*' -wholename "$E2E_REGEX_GO" -o -wholename "$E2E_REGEX_TS" | shuf)
do
if [[ $test_case != *_test.go && $test_case != *.test.ts ]] # Skip helper files
then
Expand Down Expand Up @@ -131,7 +131,7 @@ function print_logs {
}

function run_cleanup {
go test -v -tags e2e assets/cleanup_test.go
go test -v -tags e2e utils/cleanup_test.go
}

function print_failed {
Expand Down
4 changes: 2 additions & 2 deletions tests/run-arm-smoke-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ failed_lookup=()
counter=0

function run_setup {
go test -v -tags e2e assets/setup_test.go
go test -v -tags e2e utils/setup_test.go
}

function run_tests {
Expand Down Expand Up @@ -127,7 +127,7 @@ function print_logs {
}

function run_cleanup {
go test -v -tags e2e assets/cleanup_test.go
go test -v -tags e2e utils/cleanup_test.go
}

function print_failed {
Expand Down

0 comments on commit d32b9b0

Please sign in to comment.