Move tests plan from dagger dir to universe
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
63
stdlib/git/tests/git.cue
Normal file
63
stdlib/git/tests/git.cue
Normal file
@@ -0,0 +1,63 @@
|
||||
package git
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"alpha.dagger.io/git"
|
||||
"alpha.dagger.io/alpine"
|
||||
"alpha.dagger.io/os"
|
||||
"alpha.dagger.io/dagger/op"
|
||||
)
|
||||
|
||||
repo: git.#Repository & {
|
||||
remote: "https://github.com/blocklayerhq/acme-clothing.git"
|
||||
ref: "master"
|
||||
|
||||
#up: [
|
||||
op.#FetchGit & {
|
||||
keepGitDir: true
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
branch: git.#CurrentBranch & {
|
||||
repository: repo
|
||||
}
|
||||
|
||||
tagsList: git.#Tags & {
|
||||
repository: repo
|
||||
}
|
||||
|
||||
TestRepository: os.#Container & {
|
||||
image: alpine.#Image & {
|
||||
package: bash: "=5.1.0-r0"
|
||||
package: git: true
|
||||
}
|
||||
mount: "/repo1": from: repo
|
||||
dir: "/repo1"
|
||||
command: """
|
||||
[ -d .git ]
|
||||
"""
|
||||
}
|
||||
|
||||
TestCurrentBranch: os.#Container & {
|
||||
image: alpine.#Image & {
|
||||
package: bash: "=5.1.0-r0"
|
||||
package: git: true
|
||||
}
|
||||
env: BRANCH_NAME: branch.name
|
||||
command: """
|
||||
[ $BRANCH_NAME = "master" ]
|
||||
"""
|
||||
}
|
||||
|
||||
TestCurrentTags: os.#Container & {
|
||||
image: alpine.#Image & {
|
||||
package: bash: "=5.1.0-r0"
|
||||
package: git: true
|
||||
}
|
||||
env: TAGS: strings.Join([ for k, v in tagsList.tags {"\(k)=\(v)"}], "\n")
|
||||
command: """
|
||||
[ $TAGS = "0=master" ]
|
||||
"""
|
||||
}
|
Reference in New Issue
Block a user