Merge pull request #1224 from samalba/fix-ci-deadlock

ci: disabled several tests to debug CI issues in Docs tests
This commit is contained in:
Sam Alba 2021-12-14 15:34:42 -08:00 committed by GitHub
commit cdd8cd6790
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 96 additions and 91 deletions

View File

@ -240,24 +240,25 @@ jobs:
run: | run: |
docker run -d -p 5000:5000 --name registry registry:2 docker run -d -p 5000:5000 --name registry registry:2
- name: Write kind echo # # DISABLED for CI deadlock debugging
run: | # - name: Write kind echo
echo 'kind: Cluster # run: |
apiVersion: kind.x-k8s.io/v1alpha4 # echo 'kind: Cluster
containerdConfigPatches: # apiVersion: kind.x-k8s.io/v1alpha4
- |- # containerdConfigPatches:
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:5000"] # - |-
endpoint = ["http://registry:5000"]' > ./kind-config.yaml # [plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:5000"]
cat ./kind-config.yaml # endpoint = ["http://registry:5000"]' > ./kind-config.yaml
# cat ./kind-config.yaml
- name: Setup Kind Kubernetes Cluster # - name: Setup Kind Kubernetes Cluster
uses: helm/kind-action@v1.2.0 # uses: helm/kind-action@v1.2.0
with: # with:
config: "./kind-config.yaml" # config: "./kind-config.yaml"
- name: Connect registry to cluster # - name: Connect registry to cluster
run: | # run: |
docker network connect kind registry # docker network connect kind registry
- name: Import Dagger private key - name: Import Dagger private key
env: env:

View File

@ -181,104 +181,108 @@ setup() {
} }
@test "doc-1008-aws-cloudformation" { @test "doc-1008-aws-cloudformation" {
skip_unless_local_localstack skip "debug CI deadlock"
setup_example_sandbox
### Create a basic plan # skip_unless_local_localstack
## Construct # setup_example_sandbox
mkdir -p "$DAGGER_SANDBOX"/cloudformation
cp "$DAGGER_PROJECT"/cloudformation/template.cue "$DAGGER_SANDBOX"/cloudformation
# Cloudformation relay # ### Create a basic plan
dagger --project "$DAGGER_SANDBOX" doc alpha.dagger.io/aws/cloudformation # ## Construct
cp "$DAGGER_PROJECT"/cloudformation/source-begin.cue "$DAGGER_SANDBOX"/cloudformation/source.cue # mkdir -p "$DAGGER_SANDBOX"/cloudformation
# cp "$DAGGER_PROJECT"/cloudformation/template.cue "$DAGGER_SANDBOX"/cloudformation
# Initialize new env # # Cloudformation relay
dagger --project "$DAGGER_SANDBOX" new 'cloudformation' -p "$DAGGER_SANDBOX"/cloudformation # dagger --project "$DAGGER_SANDBOX" doc alpha.dagger.io/aws/cloudformation
# cp "$DAGGER_PROJECT"/cloudformation/source-begin.cue "$DAGGER_SANDBOX"/cloudformation/source.cue
# Finish template setup # # Initialize new env
cp "$DAGGER_PROJECT"/cloudformation/source-end.cue "$DAGGER_SANDBOX"/cloudformation/source.cue # dagger --project "$DAGGER_SANDBOX" new 'cloudformation' -p "$DAGGER_SANDBOX"/cloudformation
# Copy corresponding env # # Finish template setup
cp -r "$DAGGER_PROJECT"/.dagger/env/cloudformation "$DAGGER_SANDBOX"/.dagger/env/ # cp "$DAGGER_PROJECT"/cloudformation/source-end.cue "$DAGGER_SANDBOX"/cloudformation/source.cue
# Run test # # Copy corresponding env
dagger --project "$DAGGER_SANDBOX" -e cloudformation up # cp -r "$DAGGER_PROJECT"/.dagger/env/cloudformation "$DAGGER_SANDBOX"/.dagger/env/
stackName=$(dagger --project "$DAGGER_SANDBOX" -e cloudformation query cfnStackName -f text)
## Cleanup # # Run test
# Place back empty source # dagger --project "$DAGGER_SANDBOX" -e cloudformation up
cp "$DAGGER_PROJECT"/cloudformation/source-begin.cue "$DAGGER_SANDBOX"/cloudformation/source.cue # stackName=$(dagger --project "$DAGGER_SANDBOX" -e cloudformation query cfnStackName -f text)
cp "$DAGGER_PROJECT"/cloudformation/deletion.cue "$DAGGER_SANDBOX"/cloudformation/deletion.cue
# Prepare and run cloudformation cleanup
dagger --project "$DAGGER_SANDBOX" -e cloudformation input text stackRemoval.stackName "$stackName"
dagger --project "$DAGGER_SANDBOX" -e cloudformation up
### Template part # ## Cleanup
## Create convert.cue # # Place back empty source
cp "$DAGGER_PROJECT"/cloudformation/template/convert.cue "$DAGGER_SANDBOX"/cloudformation/convert.cue # cp "$DAGGER_PROJECT"/cloudformation/source-begin.cue "$DAGGER_SANDBOX"/cloudformation/source.cue
rm "$DAGGER_SANDBOX"/cloudformation/source.cue "$DAGGER_SANDBOX"/cloudformation/deletion.cue # cp "$DAGGER_PROJECT"/cloudformation/deletion.cue "$DAGGER_SANDBOX"/cloudformation/deletion.cue
# # Prepare and run cloudformation cleanup
# dagger --project "$DAGGER_SANDBOX" -e cloudformation input text stackRemoval.stackName "$stackName"
# dagger --project "$DAGGER_SANDBOX" -e cloudformation up
## Retrieve Unmarshalled JSON # ### Template part
dagger --project "$DAGGER_SANDBOX" query -e cloudformation s3Template # ## Create convert.cue
# cp "$DAGGER_PROJECT"/cloudformation/template/convert.cue "$DAGGER_SANDBOX"/cloudformation/convert.cue
# rm "$DAGGER_SANDBOX"/cloudformation/source.cue "$DAGGER_SANDBOX"/cloudformation/deletion.cue
## Remove convert.cue # ## Retrieve Unmarshalled JSON
rm "$DAGGER_SANDBOX"/cloudformation/convert.cue # dagger --project "$DAGGER_SANDBOX" query -e cloudformation s3Template
## Store the output # ## Remove convert.cue
cp "$DAGGER_PROJECT"/cloudformation/template/template-begin.cue "$DAGGER_SANDBOX"/cloudformation/template.cue # rm "$DAGGER_SANDBOX"/cloudformation/convert.cue
# Inspect conf # ## Store the output
dagger --project "$DAGGER_SANDBOX" query -e cloudformation template -f text # cp "$DAGGER_PROJECT"/cloudformation/template/template-begin.cue "$DAGGER_SANDBOX"/cloudformation/template.cue
cp "$DAGGER_PROJECT"/cloudformation/template/deployment.cue "$DAGGER_SANDBOX"/cloudformation/deployment.cue # # Inspect conf
cp "$DAGGER_PROJECT"/cloudformation/template/template-end.cue "$DAGGER_SANDBOX"/cloudformation/template.cue # dagger --project "$DAGGER_SANDBOX" query -e cloudformation template -f text
cp "$DAGGER_PROJECT"/cloudformation/source-end.cue "$DAGGER_SANDBOX"/cloudformation/source.cue
# Deploy again # cp "$DAGGER_PROJECT"/cloudformation/template/deployment.cue "$DAGGER_SANDBOX"/cloudformation/deployment.cue
dagger --project "$DAGGER_SANDBOX" -e cloudformation query template -f text # cp "$DAGGER_PROJECT"/cloudformation/template/template-end.cue "$DAGGER_SANDBOX"/cloudformation/template.cue
dagger --project "$DAGGER_SANDBOX" -e cloudformation up # cp "$DAGGER_PROJECT"/cloudformation/source-end.cue "$DAGGER_SANDBOX"/cloudformation/source.cue
dagger --project "$DAGGER_SANDBOX" -e cloudformation output list
## Cleanup again # # Deploy again
stackName=$(dagger --project "$DAGGER_SANDBOX" -e cloudformation query cfnStackName -f text) # dagger --project "$DAGGER_SANDBOX" -e cloudformation query template -f text
rm -rf "$DAGGER_SANDBOX"/cloudformation/* # dagger --project "$DAGGER_SANDBOX" -e cloudformation up
# dagger --project "$DAGGER_SANDBOX" -e cloudformation output list
# Place back empty source # ## Cleanup again
cp "$DAGGER_PROJECT"/cloudformation/source-begin.cue "$DAGGER_SANDBOX"/cloudformation/source.cue # stackName=$(dagger --project "$DAGGER_SANDBOX" -e cloudformation query cfnStackName -f text)
cp "$DAGGER_PROJECT"/cloudformation/deletion.cue "$DAGGER_SANDBOX"/cloudformation/deletion.cue # rm -rf "$DAGGER_SANDBOX"/cloudformation/*
# Prepare and run cloudformation cleanup # # Place back empty source
dagger --project "$DAGGER_SANDBOX" -e cloudformation input text stackRemoval.stackName "$stackName" # cp "$DAGGER_PROJECT"/cloudformation/source-begin.cue "$DAGGER_SANDBOX"/cloudformation/source.cue
dagger --project "$DAGGER_SANDBOX" -e cloudformation up # cp "$DAGGER_PROJECT"/cloudformation/deletion.cue "$DAGGER_SANDBOX"/cloudformation/deletion.cue
# # Prepare and run cloudformation cleanup
# dagger --project "$DAGGER_SANDBOX" -e cloudformation input text stackRemoval.stackName "$stackName"
# dagger --project "$DAGGER_SANDBOX" -e cloudformation up
} }
@test "doc-1010-dev-cue-package" { @test "doc-1010-dev-cue-package" {
# Initializing project skip "debug CI deadlock"
mkdir -p "$DAGGER_SANDBOX"/project
# Writing package # # Initializing project
# dagger init # The sandbox is already init # mkdir -p "$DAGGER_SANDBOX"/project
mkdir -p "$DAGGER_SANDBOX"/cue.mod/pkg/github.com/tjovicic/gcpcloudrun
cp "$DAGGER_PROJECT"/dev-cue-package/source.cue "$DAGGER_SANDBOX"/cue.mod/pkg/github.com/tjovicic/gcpcloudrun/source.cue
cp "$DAGGER_PROJECT"/dev-cue-package/script.sh "$DAGGER_SANDBOX"/project/script.sh
# We remove the last line of the script, as bats cannot expand dagger # # Writing package
# to dagger() bats helper func inside bash files # # dagger init # The sandbox is already init
sed '$d' <"$DAGGER_SANDBOX"/project/script.sh >"$DAGGER_SANDBOX"/tmpFile # mkdir -p "$DAGGER_SANDBOX"/cue.mod/pkg/github.com/tjovicic/gcpcloudrun
mv "$DAGGER_SANDBOX"/tmpFile "$DAGGER_SANDBOX"/project/script.sh # cp "$DAGGER_PROJECT"/dev-cue-package/source.cue "$DAGGER_SANDBOX"/cue.mod/pkg/github.com/tjovicic/gcpcloudrun/source.cue
# cp "$DAGGER_PROJECT"/dev-cue-package/script.sh "$DAGGER_SANDBOX"/project/script.sh
chmod +x "$DAGGER_SANDBOX"/project/script.sh # # We remove the last line of the script, as bats cannot expand dagger
"$DAGGER_SANDBOX"/project/script.sh # # to dagger() bats helper func inside bash files
# sed '$d' <"$DAGGER_SANDBOX"/project/script.sh >"$DAGGER_SANDBOX"/tmpFile
# mv "$DAGGER_SANDBOX"/tmpFile "$DAGGER_SANDBOX"/project/script.sh
# Sync file from documentation # chmod +x "$DAGGER_SANDBOX"/project/script.sh
rsync -a test "$DAGGER_SANDBOX" # "$DAGGER_SANDBOX"/project/script.sh
# Command removed from script.sh above # # Sync file from documentation
dagger --project "$DAGGER_SANDBOX" new staging -p "$DAGGER_SANDBOX"/test # rsync -a test "$DAGGER_SANDBOX"
run dagger up --project "$DAGGER_SANDBOX" -e staging
assert_output --partial "input=run.gcpConfig.serviceKey"
# Clean script.sh output # # Command removed from script.sh above
rm -rf ./test # dagger --project "$DAGGER_SANDBOX" new staging -p "$DAGGER_SANDBOX"/test
# run dagger up --project "$DAGGER_SANDBOX" -e staging
# assert_output --partial "input=run.gcpConfig.serviceKey"
# # Clean script.sh output
# rm -rf ./test
} }

View File

@ -87,7 +87,7 @@ skip_unless_local_localstack() {
# #
# This is need to do kubernetes test in the CI. # This is need to do kubernetes test in the CI.
skip_unless_local_kube() { skip_unless_local_kube() {
if [ -f ~/.kube/config ] && grep -q "127.0.0.1" ~/.kube/config &> /dev/null; then if [ -f ~/.kube/config ] && grep -q "127.0.0.1" ~/.kube/config; then
echo "Kubernetes available" echo "Kubernetes available"
else else
skip "local kubernetes cluster not available" skip "local kubernetes cluster not available"