Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] [DO NOT MERGE] improved integration tests a little bit #327

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github/ @lbialy @tgodzik
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ jobs:
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should stay, otherwise not password and username would be available. The release should be fixed, it seems org secrets were not set for this repo, which is why it didn't see the change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted

SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

documentation:
needs: test
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ target/
# test files
*.tml
*.yaml
tests/repositories/
integration-tests/repositories/

#general
*.class
*.log

generated-docs

# java=17.0.9-graalce if you use sdkman
.sdkmanrc
8 changes: 7 additions & 1 deletion integration-tests/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### Test suite

Yaml test suite are used in integration testing - https://github.com/yaml/yaml-test-suite
Yaml test suite are used in integration testing - https://github.com/yaml/yaml-test-suite

#### How to run integration tests

1. Figure out if `yamlpp-events` is installed on your system or install it if not, it's perl's yaml pp module
2. Run `downloadYamlConfigs.sh` script to download yaml test suites
3. `sbt integration/test` to run tests
9 changes: 5 additions & 4 deletions integration-tests/downloadYamlConfigs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ do

done

mkdir ./test-suite/jvm/src/it/resources/yaml/configs/
find ./repositories -name '*.yaml' -exec cp -prv '{}' './test-suite/jvm/src/it/resources/yaml/configs/' ';'
mkdir -p ./src/test/resources/yaml/configs/
find ./repositories -name '*.yaml' -exec cp -prv '{}' './src/test/resources/yaml/configs/' ';'

LIB_YAML_PATH="" # Set the path to libyaml
# lbialy: I think the process used here is 'yamlpp-events' so `which yamlpp-events` should be used
LIB_YAML_PATH=`which yamlpp-events` # Set the path to libyaml

# In downloaded repositories contains some invalid yaml, below instructions can remove this yaml
for f in ./test-suite/jvm/src/it/resources/yaml/configs/*.yaml; do
for f in ./src/test/resources/yaml/configs/*.yaml; do
cat $f | $LIB_YAML_PATH >/dev/null

# if libyaml return error exit code, these means, that yaml is invalid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ abstract class YamlRunnerSpec extends munit.FunSuite {
val verbose = false
val predicate: os.Path => Boolean = _ => true

val yamlDirPath = getClass.getResource(resourcePath)
val yamlDirPath = getClass.getResource(resourcePath)
if (yamlDirPath == null) {
throw new IllegalArgumentException(
s"Resource $resourcePath not found, run integrations-tests/downloadYamlConfigs.sh first!"
)
}
val yamlDir = new File(yamlDirPath.getPath)
val yamlPaths: List[os.Path] = yamlDir.listFiles().map(os.Path(_)).filter(predicate).toList

Expand Down