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

feat: make some small improvements to make this easier to use. #205

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,36 @@

The collection of jobs found in this repository make up the CI Run project.
CI Runs' aim is, when triggered by a commit to the juju repository is to:
- Create s tarball snapshot of the codebase
- Create a tarball snapshot of the codebase
- Build binaries (for use in testing and as agents)
- Update the testing streams
- Run the unit tests
- Run the suite of functional tests
- Run the suite of integration tests

The integration tests themselves are not in this repo, they are in
`github.com/juju/juju/tests/suites`. This repo contains the informaion Jekins
needs to run the tests.
## Changing the tests

To change which clouds and which versions the tests run on, edit
`./tools/gen-wire-tests/juju.config`. To change which tests are run,
edit `./jobs/ci-run/integration/integrationtests.yml`.

To build the job descriptions run:
```
JUJU_REPO_PATH="<juju-repo-on-branch-to-generate-jobs-from>" make gen-wire-tests
Copy link
Member

Choose a reason for hiding this comment

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

We have to generate from main atm

Copy link
Member

Choose a reason for hiding this comment

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

That is a very good point. We should probably get gen-wire-tests to check the branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It already does!

JUJU_REPO_PATH="/home/aflynn/Canonical/Juju/juju3/" make gen-wire-tests
2024/10/11 17:13:17 not on the tracking branch "main", or not update to date with HEAD
exit status 1
make: *** [Makefile:61: gen-wire-tests] Error 1

```

## Uploading to Jenkins

To push, you need to be on the Canonical VPN. Check that everything is working with:
```bash
make push-test
```
And push to https://jenkins.juju.canonical.com/ with:
```bash
make push
```

## Run on Noble 24.04

Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
jenkins-job-builder==6.3.0
setuptools<=65.7.0
jenkins-job-builder==6.4.1
13 changes: 8 additions & 5 deletions tools/gen-wire-tests/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"bufio"
"fmt"
"io"
"io/ioutil"
"log"
"os"
Expand Down Expand Up @@ -106,11 +107,13 @@ func main() {
log.Fatal("unable to create output dir", outputDir)
}
} else {
log.Println("Warning: Output Directory already exists. It may overwrite files!")
log.Printf("Warning: Output directory %q already exists. It may overwrite files!\n", outputDir)
// Remove all yaml files so that git can track deleted files as well as new ones.
outFiles, err := outDir.Readdirnames(0)
if err != nil {
log.Fatalf("unable to read output dir files: %v", err)
log.Println("")
log.Fatalf("unable to read output dir files: %v\n "+
"If you are having an issue reading from stdin, check your terminal is not part of a strictly confined snap (e.g. an built-in IDE terminal)", err)
}
for _, f := range outFiles {
if !strings.HasSuffix(f, ".yml") {
Expand All @@ -123,13 +126,13 @@ func main() {
}

reader := bufio.NewReader(os.Stdin)
bytes, err := ioutil.ReadAll(reader)
bytes, err := io.ReadAll(reader)
if err != nil {
log.Fatal("unexpected config", err)
log.Fatal("unexpected config: ", err)
}
var config Config
if err := yaml.Unmarshal(bytes, &config); err != nil {
log.Fatal("config parse error", err)
log.Fatal("config parse error: ", err)
}

dirs, err := ioutil.ReadDir(inputDir)
Expand Down
Loading