Skip to content

Commit

Permalink
Rename integration tests in system tests (#4146)
Browse files Browse the repository at this point in the history
Integration tests is an expression that covers a lot of different ways
to test, depending of the backgrounds of the people that use it. System
tests is probably a better term in our case, as it is a less overloaded
term. It was inspired by Rails projects.
  • Loading branch information
nono authored Oct 5, 2023
2 parents 1bccc17 + 0076104 commit 931964f
Show file tree
Hide file tree
Showing 72 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Integration tests
name: System tests
on:
push:
branches:
Expand All @@ -9,7 +9,7 @@ on:
paths-ignore:
- 'docs/**'
jobs:
integration:
system:
runs-on: ubuntu-22.04
services:
mailhog:
Expand Down Expand Up @@ -54,4 +54,4 @@ jobs:
go install
- name: Test
run: |
make integration-tests
make system-tests
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ scripts/golangci-lint: Makefile

## jslint: enforce a consistent code style for Js code
jslint: scripts/node_modules
@scripts/node_modules/.bin/eslint -c scripts/eslintrc.json "assets/scripts/**" tests/integration/konnector/*.js
@scripts/node_modules/.bin/eslint -c scripts/eslintrc.json "assets/scripts/**" tests/system/konnector/*.js
.PHONY: jslint

## pretty: make the assets prettier
Expand Down Expand Up @@ -74,10 +74,10 @@ unit-tests:
@go test -p 1 -timeout 2m -short ./...
.PHONY: unit-tests

## integration-tests: run the tests
integration-tests:
@scripts/integration-test.sh
.PHONY: integration-tests
## system-tests: run the tests
system-tests:
@scripts/system-test.sh
.PHONY: system-tests

## clean: clean the generated files and directories
clean:
Expand Down
8 changes: 4 additions & 4 deletions cmd/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ var encryptRSACmd = &cobra.Command{
Use: "encrypt-with-rsa <key> <payload",
Short: "encrypt a payload in RSA",
Long: `
This command is used by integration tests to encrypt bitwarden organization
keys. It takes the public or private key of the user and the payload (= the
organization key) as inputs (both encoded in base64), and print on stdout the
encrypted data (encoded as base64 too).
This command is used by system tests to encrypt bitwarden organization keys. It
takes the public or private key of the user and the payload (= the organization
key) as inputs (both encoded in base64), and print on stdout the encrypted data
(encoded as base64 too).
`,
RunE: func(cmd *cobra.Command, args []string) error {
if len(args) != 2 {
Expand Down
8 changes: 4 additions & 4 deletions docs/cli/cozy-stack_tools_encrypt-with-rsa.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ encrypt a payload in RSA
### Synopsis


This command is used by integration tests to encrypt bitwarden organization
keys. It takes the public or private key of the user and the payload (= the
organization key) as inputs (both encoded in base64), and print on stdout the
encrypted data (encoded as base64 too).
This command is used by system tests to encrypt bitwarden organization keys. It
takes the public or private key of the user and the payload (= the organization
key) as inputs (both encoded in base64), and print on stdout the encrypted data
(encoded as base64 too).


```
Expand Down
8 changes: 4 additions & 4 deletions model/job/mem_scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ func (s *memScheduler) StartScheduler(b Broker) error {
go s.thumb.Schedule()

// XXX The memory scheduler loads the triggers from CouchDB when the stack
// is started. This can cause some stability issues when running
// integration tests in parallel. To avoid that, an env variable
// is started. This can cause some stability issues when running system
// tests in parallel. To avoid that, an env variable
// COZY_SKIP_LOADING_TRIGGERS can be set to skip loading the triggers from
// CouchDB. It is correct for integration tests, as instances are created
// and destroyed by the same process. But, it should not be used elsewhere.
// CouchDB. It is correct for system tests, as instances are created and
// destroyed by the same process. But, it should not be used elsewhere.
for _, env := range os.Environ() {
if strings.HasPrefix(env, "COZY_SKIP_LOADING_TRIGGERS=") {
return nil
Expand Down
2 changes: 1 addition & 1 deletion scripts/integration-test.sh → scripts/system-test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -ev

cd tests/integration
cd tests/system
sudo npm install -g @bitwarden/cli@1.16.0

bundle install --jobs=3 --retry=3
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/integration/README.md → tests/system/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Tools for integration tests
# Tools for system tests

## Install

Expand All @@ -7,7 +7,7 @@ apt install ruby ruby-dev
gem install bundler
cd cozy-stack
go install
cd tests/integration
cd tests/system
bundle install
npm install -g @bitwarden/cli@1.16.0
```
Expand Down Expand Up @@ -74,7 +74,7 @@ it with swifttest:

```sh
$ go run ./tests/swift
$ cd tests/integration
$ cd tests/system
$ export COZY_SWIFTTEST=1
$ bundle exec ruby tests/sharing_push_folder.rb
```
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
set -e

# Usage: ./hammer-runner.sh tests/accounts_cleaning.rb
# It will launch the same integration tests in a loop until it fails (up to 100
# tries). It is useful for trying to trigger an error on an integration test
# It will launch the same system tests in a loop until it fails (up to 100
# tries). It is useful for trying to trigger an error on an system test
# that fails on some conditions that happen sometimes, but not very often.

bundle exec ruby clean.rb
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.
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
Expand Up @@ -6,7 +6,7 @@ def self.create(inst)
body = {
redirect_uris: ["cozy://"],
client_name: "test_#{Faker::Internet.slug}",
software_id: "github.com/cozy/cozy-stack/tests/integration"
software_id: "github.com/cozy/cozy-stack/tests/system"
}
opts = { content_type: :json, accept: :json }
res = inst.client["/auth/register"].post body.to_json, opts
Expand Down
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
Expand Up @@ -156,7 +156,7 @@ def generate_token_for(inst, doctypes)
def generate_client_id(inst)
cmd = ["cozy-stack", "instances", "client-oauth", inst.domain,
"--admin-port", @admin,
"http://localhost", "test-sharing", "github.com/cozy/cozy-stack/tests/integration"]
"http://localhost", "test-sharing", "github.com/cozy/cozy-stack/tests/system"]
puts cmd.join(" ").green
`#{cmd.join(" ")}`.chomp
end
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.
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.

0 comments on commit 931964f

Please sign in to comment.